PDA

View Full Version : having problems linking



codecrank
01-27-2004, 10:34 AM
Hi, I am trying to compile example 1 and 2 from the OpenGL programmer's guide, on opengl.org. I did install glut3.7 ( make install did not work so i had to manually copy the files...). i compile using:

gcc file.c -Wall -lGL -lGLU -lX11 -lXext -lXmu -lglut

when i compile example 1 i get:
test.c: In function `main':
test.c:9: warning: implicit declaration of function `InitializeAWindowPlease'
test.c:24: warning: implicit declaration of function `UpdateTheWindowAndCheckForEvents'
/tmp//ccyMAgvM.o(.text+0x11): In function `main':
: undefined reference to `InitializeAWindowPlease'
/tmp//ccyMAgvM.o(.text+0x13e): In function `main':
: undefined reference to `UpdateTheWindowAndCheckForEvents'
collect2: ld returned 1 exit status

and for example2 i get:
/usr/X11R6/lib//libglut.a(glut_util.o)(.text+0xc9): In function `glutReportErrors':
: undefined reference to `gluErrorString'
collect2: ld returned 1 exit status


Any help would be greatly appreciated.

-Thanks

[This message has been edited by codecrank (edited 01-27-2004).]

lulf
01-28-2004, 12:05 PM
Well, you've misunderstood a little.

Example 1 is not compileable, because it misses functions to handle screen and window.

Example2 or so should work though.

Those function-names are just there to illustrate what code does before and after the OpenGL spesific stuff.

azcoder
01-30-2004, 02:47 PM
For example 2, make sure that you that you have libGLU.so in /usr/lib. The function gluErrorString is exported from libGLU.so and the linker cannot find it.

Happy Coding

codecrank
01-31-2004, 02:31 PM
oooh man, i had forgot to add a -L/usr/X11R6/lib" in my last build attempt... Doh!

Thanks guys