PDA

View Full Version : Compile Error



cyclopentane
10-09-2003, 08:34 PM
I believe that I have everything installed already in order to compile my code. I am running Mandrake 8.1. I am able to compile my code no problem on some school machines. I don't know if I am compiling incorrectly or what. I used the command:

g++ -o checker checker.cpp -L/soft/X11R6.3/lib -lGL -lGLU -lglut -lX11

This allowed me to compile my code no problem. Well I know that the GL library is located in a different place on my computer. It is at /usr/X11R6. So I have tried the command:

g++ -o checker checker.cpp -L/usr/X11R6/lib -lGL -lGLU -lglut -lX11

However I get an error when I try this command. I am not sure what to do or if I am doing everything right. The error I receive is:

/usr/bin/ld: cannot find -lglut
collect2: ld returned 1 exit status

Any help would be greatly appreciated. Thanks to anyone that can help.

Pete

odubtaig
10-10-2003, 12:00 AM
I seem to remember Mandrake not coming with glut by default but, just in case, it should be in your /usr/lib directory.

If ls /usr/lib/libglut* doesn't come up with anything the you need to download and install glut or some version thereof. If, it does then type echo $LD_LIBRARY_PATH. If this just gives you a blank line then type export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib and if you can compile your code now then you need to add that line to /etc/profile (or ~/.profile if you do not have root/wheel priviledges).

hth, Paul

cyclopentane
10-10-2003, 07:39 AM
Well, it does not have glut installed. So I am scraping Mandrake and going to install RedHat 9. I have never really liked mandrake anyways. Hopefully I can get it working in Redhat 9.

Thanks for the advice Paul