Welcome

Troves being gleaned while surfing on the Internet mostly about computer/IT/system skills and tricks, Welcome here ...
Powered By Blogger

Disclaimer

This blog is written by the owner with real practices and tests and intended to hold all original posts except there is a clear declaration for referencing from others. Thanks for tagging with the source link or other tips for reference from here if you would like to quote partial or full text from posts in this blog.

Friday, May 27, 2011

building installation of freeglut ------ problem with /usr/lib/libGL.so.1 or /lib/libm.so.6

When setting up freeglut with the source code package downloaded from sourceForge in the Fedora Linux environment, there always complains in the link step about loss of either of following two dynamically-linked libraries on the linker's command line:

/usr/lib/libGL.so.1
/lib/libm.so.6

The typical prompt would be like the lines as follows:

freeglut is defined in DSO /usr/lib/libGL.so.1 so try adding it to the linker command line

A very gauche approach is to edit each Makefile spread over different levels of directories in the source code root, by changing each "CC=gcc" line to "CC=gcc /usr/lib/libGL.so.1 /lib/libm.so.6". Obviously, you will need much pissy manual work to treat this nasty problem.

Here what I would like to share is a cheaper yet perky way, maybe not that paradigmatic though, to the quick solution:

1. enter /usr/bin/  (or somewhere else gcc lies, the location can be retrieved by whereis gcc );
2. mv gcc gcc_org 
3. touch gcc and add following lines in it:
#!/bin/bash

/usr/bin/gcc_org $@ /usr/lib/libGL.so.1 /lib/libm.so.6


4. chmod +x gcc

Now get back to glut source package directory and follow the original instruction, that is, "./configure" -> "make && make install".

You should not expect further problems until everything will be set up well there.

After done, do not forget to clean up the your cheating spot : move to /usr/bin,
and "mv gcc_org gcc".