compilation errors

Hi,
i am running SusE Linux 9 with a downloaded nvidia driver (I am not 100 % sure it is installed correctly…)

When I am trying to compile a simple OpenGL program with

gcc -o gears gears.c -lGL -lGLU -lglut -lm

I get a lot of errors, like:

/usr/lib/gcc-lib/i586-suse-linux/3.3.1/…/…/…/libGL.a(glthread.o)(.text+0xc5): In function _glthread_SetTSD': : undefined reference to pthread_setspecific’
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/…/…/…/libglut.so: undefined reference to glXQueryExtension' /usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../libglut.so: undefined reference to glXMakeCurrent’

I have no idea how to solve this problem, can anybody help ?

Glxinfo says:

name of display: :0.0
Xlib: extension “GLX” missing on display “:0.0”.
Xlib: extension “GLX” missing on display “:0.0”.
Xlib: extension “GLX” missing on display “:0.0”.
Error: couldn’t find RGB GLX visual

I am sure there is a connection between the two, but I am not able to solve the problem on my own.

THX

Ensure you have Load “glx” in the Section module inside your /etc/X11/XF86Config-4 or inside /etc/X11/xorg.conf, depending on what X11 you have.

This should resolve your problem.

You’ll also check if you have Driver = “nvidia” inside the Device section.

Both are explained inside /usr/share/doc/nvidia files and in plenty web pages too.

Hope this helps.

do the following:

  1. run ‘glxgears’. it should be installed on your system, if it is not yet, it’s definitely included in suse 9.1. i have a geforce 4 mx 440 and get 1200 fps in window and 140 in fullscreen mode. so if you get less, you didn’t install your nvidia driver right. by the way, if the nvidia driver is properly installed, you should see a white screen with a nvidia logo when starting x windows.

  2. as jide said, the glxinfo output seems to show that your XF86Config is wrong.

  3. according to the compiler output, you have to add a flag for the pthread library :

gcc -o gears gears.c -lGL -lGLU -lglut -lm -lpthread

it is a bit strange to me that the glX… functions are not found. actually they should be in libGL. some hints to handle this:

on my suse system the opengl library is located in /usr/lib/libGL.so.1 . type

readelf -s /usr/lib/libGL.so.1 | grep glX

to get a list of all functions which are included in the library and start with “glX”. so if you do not find glXQueryExtension and glXMakeCurrent in the list, you have the wrong library.

if you do not find your libGL, but have a program running which uses opengl (like glxgears), type

ldd glxgears

to get info about which libraries the programs uses and where they are to be found.

good luck!

The X system configuration (Include “glx” etc) should
be independent of compilation. The fact that you get
glxinfo errors about GLX indicates that your glx
extension cannot be loaded. There could be many
reasons for this; incorect/incomplete X installation,
misconfiguration, etc. Also check the XFree86.log
file for errors regarding glx. Remember, under the
X system, the glx extensions are the life of OpenGL.

Now, with regard to compilation errors, you can search
for files such as libGLcore.a, libGLU.a, libGL.a,
and “dump” those archive files to the compilation
line and see if errors persist. This is a terrible hack,
but it is worth trying. It is also a good idea to
throw in “-lpthread” which will link using the
POSIX threads library, but that might not be
standard in some linux distributions/installations.

Final thought: there is something wrong with your
installation of the X or more than that. I recommend
that you first get X running well, with glx so
that you do not get glxinfo errors, etc. Then try
to compile (and make sure the code runs with just
software rendering), and finally perform the nVidia
installation, and the above tests all over again.
Make a backup of your system before you do any of
this.

Has anyone noticed that it is usually people with
nVidia cards who have compilation/installation
problems? Long live “closed” and “propriatery”
drivers…

Originally posted by GreetingsFromMunich:
[b]do the following:

  1. according to the compiler output, you have to add a flag for the pthread library :

gcc -o gears gears.c -lGL -lGLU -lglut -lm -lpthread

it is a bit strange to me that the glX… functions are not found. actually they should be in libGL. some hints to handle this:

[/b]
I don’t think he really needs pthread libraries. It’s about glthread.o not pthreads. Neither he explicitly needs to add the maths libraries
that is automatically added (but if he is using complex makefiles).

Also, it appears that he is using libGL.a, which is not providen with nvidia drivers if I’m not wrong. And it’s also strange that the drivers didn’t uninstall ‘old gl libs’.

Originally posted by iznogoud:

Has anyone noticed that it is usually people with
nVidia cards who have compilation/installation
problems? Long live “closed” and “propriatery”
drivers…

Well: what about you ? :confused:

But that’s right that libGL.so stands in usr/lib after nvidia installation, whereas GLU generally stands in /usr/X11R6/lib…
Otherwise, I got only very few compilation problems, just like when I use simply Mesa instead of nvidia.

For development I use a AGP Voodoo 3 16MB with MESA/DRI,
but I do most practical things on an nVidia. I like the low end
card because it helps me identify performance bottlenecks,
if you know what I mean.

If I were to recommend one thing to the nVidia users,
it would be to make a backup of their working system
prior to installing the nVidia drivers. The really
smart ones should see what files are replaced and
do what it takes to have an alternative X configuration,
even if that means that there is not hardware acceleration,
so that they can diagnose problems.

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