View Full Version : link troubles with glx
I'm trying to port a GL program i wrote to Linux. I installed Knoppix 3.3 on HD and got latest NVIDIA drivers to work properly.
I fetched the up to date glxext.h, gl.h and glext.h files.
As I don't want to use other libraries to get extensions, i'm trying to use glXGetProcAddress to fill my function pointers. The problem is that my code compiles but fails to link, telling "undefined reference glXGetProcAddress". I've been seraching the whole system for some libglx.a but i can't find it, i just find libglx.so and similar but i can't think where to find link libraries.
Can you help?
Is this the only one GL/GLX function which gets this error? If not, then maybe the whole GL library is not there. If you already linked to the GL library (-lGL) then I don't know.
I've already (and quiete recently) encountered the same problem. glXGetProcAddress is not defined on some systems in profit of glXGetProcAddressARB.
One of the latest NVidia drivers make me that.
However I don't fix it. The problem is in glx.h, about some preprocessor definitions, but I don't really know how to behave fronting such a situation.
Thanks both for your answer. My libraries are correctly linked ( -lGL -lGLU -lglut ) so perhaps it's some kind of trouble with the header file. Mine defines glXGetProcAddress and not glXGetProcAddressARB, maybe I'll be able to fix it by tinkering on some typedef, but I'm begginning to feel a bit hopeless.
I'd be grateful If you could post again if you find some way to work around this problem. If i find it first I'll tell you of course!
Hope some linux/nvidia guru will check this post sooner or later.
04-06-2004, 11:39 AM
If you have libglx.so, you should be able to use -lglx. You may have to do something like -L/folder-that-contains-libglx.so/, though
Eureka! I found out. As usual I should have read the whole readme file and not just the first three lines...
Nvidia driver come with proper gl.h, glx.h and glext.h for the .so library they install, but they won't automatically overwrite your headers. They will put them in usr/share/doc/NVIDIA-GLX/... in case you need them.
All i had to do was overwrite my old header with these ones and it worked ( i think without -lglx ). You can find more info on NV driver readme.
Thank everyone for posting, hope this will be useful to others!
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.