Having problems linking

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).]

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.

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

oooh man, i had forgot to add a -L/usr/X11R6/lib" in my last build attempt… Doh!

Thanks guys

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.