PDA

View Full Version : Basic installation



04-06-2001, 07:09 AM
A newbie question:

I have just installed redhat 7.1 on my desktop. And the GL dir is found in the /usr/include. But when i try to compile the sample program, the error message said "undefined reference on "glColor"
"undefined reference on "glVertex3f" ..............

What's problem

Labbit

rts
04-06-2001, 07:57 AM
Those sound like linker problems, in which case you aren't linking properly. Something like the following:

gcc ...... -L/usr/X11R6/lib -lGL -lGLU -lglut -lX11


should do it (you don't need the -lglut if you aren't using glut, and -lX11 may not be necessary either). Replace ... with your own stuff.

04-07-2001, 07:40 PM
It works now! So it means I need to compile all file by such a "long" command: "gcc -o file file.c -L/usr/X11R6/lib -lGL -lGLU -lglut"?
Could i do some way shorter?

rts
04-07-2001, 09:56 PM
Yeah.

Use a Makefile.

Hope this helps.