PDA

View Full Version : Error



leo0801
01-30-2002, 04:46 PM
I am a student studying OPENGL now.
However, I really do not understand what is going on.
I use c program in the Linux 8.1
The code I type below:
------------------------------------
#include <GL/gl.h>

main()
{
glClear();
}
-----------------------------------------

when I compliy, the error message show below:
-----------------------------------------
[]$ gcc prog1.c
/temp/ccdyk0ia.o: In function 'main' :
/temp/ccdyk0ia.o(.text+0x7): undefined reference to 'glClear'
collect 2: ld returned 1 exit status
[]$

jackz
01-31-2002, 12:23 AM
Originally posted by leo0801:
I am a student studying OPENGL now.
However, I really do not understand what is going on.
I use c program in the Linux 8.1
The code I type below:

Try gcc prog1.c -o prog1 -lGL <-- this links your program to libGL.so