Problems with libraries

I am running RedHat WS 4 Linux 64bit with a dual processor. However after a recent update my OpenGL code written in C++ no longer runs. I get the following error:

/usr/X11R6/lib64/libGL.a(glthread.o)(.text+0x17): In function _glthread_InitTSD ': : undefined reference to pthread_key_create’
/usr/X11R6/lib64/libGL.a(glthread.o)(.text+0x55): In function _glthread_GetTSD' : : undefined reference to pthread_getspecific’
/usr/X11R6/lib64/libGL.a(glthread.o)(.text+0x96): In function _glthread_SetTSD' : : undefined reference to pthread_setspecific’
/usr/X11R6/lib64/libGL.a(glxext.o)(.text+0x15): In function __glXGetCurrentCont ext': : undefined reference to pthread_key_create’
/usr/X11R6/lib64/libGL.a(glxext.o)(.text+0x37): In function __glXGetCurrentCont ext': : undefined reference to pthread_getspecific’
/usr/X11R6/lib64/libGL.a(glxext.o)(.text+0x78): In function __glXSetCurrentCont ext': : undefined reference to pthread_key_create’
/usr/X11R6/lib64/libGL.a(glxext.o)(.text+0x68): In function __glXSetCurrentCont ext': : undefined reference to pthread_setspecific’
/usr/X11R6/lib64/libGL.a(glxext.o)(.text+0x8e): In function __glXSetCurrentCont ext': : undefined reference to pthread_setspecific’
collect2: ld returned 1 exit status
make: *** [SS] Error 1

My Makefile:

   
CXX=g++
CXXFLAGS=-g
OBJS=Main.o Viewer.o ArcBall.o
LIBS=-L/usr/X11R6/lib64 -lGLU -lGL   -lgd -lXxf86vm


all: SS

SS: $(OBJS)
	$(CXX) $(OBJS) -o $@ $(LIBS)

clean:
	rm -f $(OBJS)  

Include files:

  
#include <stdio.h>
#include <sys/time.h>
#include <time.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glx.h>
#include <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>
#include <X11/keysym.h>
#include <string.h>
#include <iostream.h>
#include <fstream.h>
#include "gd.h"
#include "Main.h"

#include "math.h"

#include "ArcBall.h"

I have changed these library inclusion in the Makefile but to no avail. But still nothing seems to work. Please advise how I can fix this???

adding -lpthread to the LIBS flags should help…

Hi

Have included the flags, but now the code compiles but does not run properly. It errors giving the following result:

XF86VMExt-Version 2.2
Xlib: extension “GLX” missing on display “:0.0”.
Xlib: extension “GLX” missing on display “:0.0”.
Single Buffered visual
Xlib: extension “GLX” missing on display “:0.0”.
glx-version 5821208.0
Xlib: extension “GLX” missing on display “:0.0”.
Segmentation fault

now you need install properly GL drivers and enable GLX support on your X system.

how to do that depends on whether you want/can have hardware acceleration, and the type of your graphic card.

http://www.opengl.org/wiki/index.php/Getting_started#Linux

all I did was update the kernel, using the up2date option and now nothing I try seems to work.

I think the machine has an nvidia card, but am not sure. How can I tell? I have tried also running the Nvidia update but it complains that I am running x-windows.

Any thoughts?

a) open the casing and take a look inside
b) log in as root, open a shell and type lspci.

if you want to install the nvidia driver, you’ll
have to shutdown x-windows. when the installation
was successful, you can start x again without rebooting.

did you try to see if glx is installed ? also is it listed in you X configuration file ?
also, what does glxinfo tells you ? also check what the x log tells.

Give pretty much information.

I havw tried typing lspci - but to no avail?

lspci
bash: lspci: command not found

try

/sbin/lspci

or

more /proc/driver/nvidia/version

Ok great that works - now its nvidia. Now how do I kill X -windows?

login as root, open a shell, type ‘init 3’
this should stop the display manager and take you
to the text console. when you’re there, you’ll
have to log in again (as root), before you can
start the installation.

when you’re done, type ‘init 5’. this should start the display manager again. or, as a last resort,
‘shutdown -r now’. this will reboot the computer.

could this completely screw things up? I am a bit worried that if things go wrong I will no longer have access to my computer?

it could be a good idea to setup your system not to start the display manager after booting.

unfortunately, i don’t know how to do this in redhat. i have suse 10.0, in which you can start
a runlevel editor, which determines in which
runlevel the system is started.

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