PDA

View Full Version : Can't Get NeHe Code to Compile



08-02-2000, 03:51 AM
i just installed mesa on Linux Mandrake 7.0 and just to assure myself that i got it running properly i downloaded the tutorial code from the
NeHe tutorial Lesson 1 (Unix version by Richard Campbell ) and tried compiling lesson1.c. Needless to say it doesn't compile. This is what I
get:

$ make lesson1
gcc -Wall -I/usr/include/ -c lesson1.c -o lesson1.o
gcc -Wall -I/usr/include/ -o lesson1 -L/usr/X11R6/lib lesson1.o -lX11 -lXi -lXmu -lglut -lGL -lGLU -lm
/usr/bin/ld: cannot find -lglut
collect2: ld returned 1 exit status
make: *** [lesson1] Error 1
rm lesson1.o

i appear to be missing a library. can anyone help with some pointers where i have gone wrong. i am assuming of course that the tutorial code
is correct. BTW i ran the demos

make exec

and they all run fine.

thanks for any help - hope i'm not off topic!

Beh

Epidemi
08-02-2000, 05:09 AM
Well, I don't have my linux up and running now, but assuming the -l parameter is correct (trying to add an include-dir. to the path?) I guess that your `glut' directory doesn't exist.

Again, i can't test anything cuz my linux and gcc are not installed right now.

ngill
08-02-2000, 06:41 PM
doesn't glut come with mesa?

MC
08-03-2000, 12:35 AM
You probably miss GLUT library (but normaly they comes with mesa)

Be sure to have also the development librarie (the .a file).

And don't forger to run ldconfig as root when you install new library

-lgnagna is used to tell the linker to link against libgnagna.a library (or libgnagna.so)

-L/path/to/somewhere

Tell the linker to find libgnagna in /path/to/somewhere (and also in standart path like /lib /usr/lib and LD_LIBRARY_PATH variable)

/sbin/ldconfig references all dynamic loaded libs which are in /lib /usr/lib and all path listed in /etc/ld.so.conf (so put /usr/X11R6/lib and /usr/local/lib into)

08-03-2000, 06:51 AM
yes, the mesa doc does state that glut comes with mesa. i probably don't have the libs in the right place.

i'll poke around with it a little more - got to go out of town tomorrow and will have to let it sit for a week ....

thanks for the input.