Panic, glut library and compile!


I recently installed glut-3.6 in my linux system. The installation was successful and I added the “LD_LIBRARY…” path to my shell.

Then I tried to compile a simple glut file with the command:

cc -o hello hello.c -lglut

Now the problems start, “cc” outputs a series of strange errors like:

/usr/bin/…/lib/ undefined reference to XFreePixmap' /usr/bin/../lib/ undefined reference to XSetWMProtocols’
/usr/bin/…/lib/ undefined reference to `XSetWMIconName’

etc…what is the damn problem? My glut library isnt in the directory /usr/lib, does it have anything to do with that??? Im running linhx RH6.22 with Xfree86 4.01.



The problem is that you have to link other libraries other than glut, try to add after -lglut: -lX11 -lXi -lXmu -lXext. Then if it doesn’t work yet and the error is similar (undefined reference to some function), there are other libraries that you have to find and link that contain these function, it may help the command ‘nm’ to list the name of functions in a library (see the man pages)


Thanks! In what lib is it possible to find math functions like: sqrt, floor, cos and sin???



m for math…


This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.