View Full Version : Problems with libraries

03-30-2006, 08:47 AM
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:

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

all: SS

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

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???

03-30-2006, 09:55 AM
adding -lpthread to the LIBS flags should help...

03-31-2006, 02:26 AM

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

03-31-2006, 02:34 AM
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.


04-07-2006, 03:31 AM
all I did was update the kernel, using the up2date option and now nothing I try seems to work.

04-07-2006, 04:03 AM
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?

04-07-2006, 04:09 AM
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.

04-07-2006, 06:52 AM
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.

04-07-2006, 06:55 AM
I havw tried typing lspci - but to no avail?

bash: lspci: command not found

04-07-2006, 07:02 AM



more /proc/driver/nvidia/version

04-07-2006, 07:19 AM
Ok great that works - now its nvidia. Now how do I kill X -windows?

04-07-2006, 07:30 AM
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.

04-07-2006, 07:59 AM
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?

04-07-2006, 08:10 AM
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.