Opengl simple program, libraries error

Need help with C, C++, perl, python, etc?

Opengl simple program, libraries error

Postby oufresh » 2007-01-05 15:20

HI! I'm using Debian testing and I'm trying to write some simple programs using Opengl with glx (X libraries). I have xorg 7.
I used to link the .o files with the options -L/usr/X11R6/lib -lGL -lXext -lX11, as written in the OpenGl manual.
Now, when I use the previous options, gcc returns the errors:

glxsimple.o: In function `redraw':
glxsimple.c:(.text+0x2f8): undefined reference to `glxSwapBuffers'
glxsimple.o: In function `main':
glxsimple.c:(.text+0x373): undefined reference to `glxQueryExtension'
glxsimple.c:(.text+0x3a8): undefined reference to `glxChooseVisual'
glxsimple.c:(.text+0x3d6): undefined reference to `glxChooseVisual'
glxsimple.c:(.text+0x430): undefined reference to `glxCreateContext'
glxsimple.c:(.text+0x59e): undefined reference to `glxMakeCurrent'
collect2: ld returned 1 exit status

It seems that it doesn't find the libglx!
Maybe whith xorg I have to use different options....
Thanks for help!

Mod edit: Disabled smilies since it messed up the post.
oufresh
 
Posts: 2
Joined: 2007-01-05 15:05

Postby shoof » 2007-01-05 15:22

with X.org libs are in /usr/lib/xorg/
shoof
 
Posts: 379
Joined: 2006-09-08 20:41
Location: My chair

Postby oufresh » 2007-01-20 09:56

Hi, I tried to compile with gcc -o glxsimple glxsimple.o -L/usr/lib/xorg -lGL -lX11 -lXext but I had the same error...
oufresh
 
Posts: 2
Joined: 2007-01-05 15:05

Re: Opengl simple program, libraries error

Postby runningwithscissors » 2007-01-26 14:36

oufresh wrote:Now, when I use the previous options, gcc returns the errors:

glxsimple.o: In function `redraw':
glxsimple.c:(.text+0x2f8): undefined reference to `glxSwapBuffers'
glxsimple.o: In function `main':
glxsimple.c:(.text+0x373): undefined reference to `glxQueryExtension'
glxsimple.c:(.text+0x3a8): undefined reference to `glxChooseVisual'
glxsimple.c:(.text+0x3d6): undefined reference to `glxChooseVisual'
glxsimple.c:(.text+0x430): undefined reference to `glxCreateContext'
glxsimple.c:(.text+0x59e): undefined reference to `glxMakeCurrent'
collect2: ld returned 1 exit status

That is because the 'X' in all glX functions is uppercase.
Happiness, is not being afraid. -- Roy Keane (supposedly)
User avatar
runningwithscissors
 
Posts: 3
Joined: 2007-01-26 14:18


Return to Programming

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable