NVidia, Glut and Rock´n Roll! :(

I can´t can compile a simple program.
I use linux Mandrake 8.1, updated my Mesa Libs
…libMesaglut3-4.0-2mdk
libMesaglut3-devel-4.0-2mdk
Mesa-4.0-2mdk
libMesaGLU1-devel-4.0-2mdk
libMesaGL1-4.0-2mdk
libMesaGLU1-4.0-2mdk…
and tried to compile a simple program with:
gcc ZickZack.cpp -lglut -lGL -lGLU -lm -o ZickZack
If i compile it with the directory:
gcc ZickZack.cpp -lglut -lGL -lGLU -L/usr/X11R6/lib -lm -o ZickZack
it fails with:


.
glxext.o(.text+0x155a): undefined reference to pthread_key_create' glxext.o(.text+0x1577): undefined reference to pthread_setspecific’
/usr/X11R6/lib/libGL.a(glxext.o): In function __glXSetupForCommand': glxext.o(.text+0x15b1): undefined reference to pthread_key_create’
glxext.o(.text+0x15d1): undefined reference to pthread_getspecific' /usr/X11R6/lib/libGL.a(glxext.o): In function __glXCloseDisplay’:
glxext.o(.text+0x1651): undefined reference to pthread_key_create' glxext.o(.text+0x1671): undefined reference to pthread_getspecific’
glxext.o(.text+0x169a): undefined reference to pthread_key_create' glxext.o(.text+0x16b7): undefined reference to pthread_setspecific’
/usr/X11R6/lib/libGL.a(glthread.o): In function _glthread_InitTSD': glthread.o(.text+0x1e): undefined reference to pthread_key_create’
/usr/X11R6/lib/libGL.a(glthread.o): In function _glthread_GetTSD': glthread.o(.text+0x6a): undefined reference to pthread_key_create’
glthread.o(.text+0x9e): undefined reference to pthread_getspecific' /usr/X11R6/lib/libGL.a(glthread.o): In function _glthread_SetTSD’:
glthread.o(.text+0xca): undefined reference to pthread_key_create' glthread.o(.text+0x102): undefined reference to pthread_setspecific’
/usr/X11R6/lib/libglut.so: undefined reference to glXBindChannelToWin dowSGIX' /usr/X11R6/lib/libglut.so: undefined reference to glXCreateContextWit hConfigSGIX’
/usr/X11R6/lib/libglut.so: undefined reference to glXGetFBConfigAttri bSGIX' /usr/X11R6/lib/libglut.so: undefined reference to glXQueryChannelDelt asSGIX’
/usr/X11R6/lib/libglut.so: undefined reference to glXChannelRectSyncS GIX' /usr/X11R6/lib/libglut.so: undefined reference to glXChannelRectSGIX’
/usr/X11R6/lib/libglut.so: undefined reference to glXQueryChannelRect SGIX' /usr/X11R6/lib/libglut.so: undefined reference to glXGetFBConfigFromV isualSGIX

What do I wrong. Are there some broken dependencies with the NVIDIA GLX Libs? What works for you? Can someone post some examples , what is working?? I you wand to need the code of the program, just say it. I would post it, but for other people it worked. They usin SuSE but have no NVIDIA TNT2 Cards with Hardware Acceleration enabled.

Thanks! Thanks!!

You should not mix the OpenGL libraries from nvidia with Mesa. You can use GLU and GLUT from Mesa but if you want hardware acceleration should the OpenGL library be nvidias.
Reinstall the nvidia package so some Mesa libraries is replaced. Do not forget that you have to have the kernel sources installed if you are installing the source version.

Hm… this doesn´t work for me. I reinstalled the Driver and the GLX Modul, but the Linker can´t find the GLU Libary
gecko$ gcc -o program program.cpp -lGL -lGLU
/usr/bin/ld: cannot find -lGLU
collect2: ld returned 1 exit status
But if i look for the Lib - i find:
/usr/X11R6/lib/libGLU.so.1

So /home/roman/tmp/ccbJBb5M.o: In function stroke_output(float, float, char*, ...)': /home/roman/tmp/ccbJBb5M.o(.text+0x80): undefined reference toglutStrokeRoman’
/home/roman/tmp/ccbJBb5M.o(.text+0x85): undefined reference to glutStrokeCharacter' /home/roman/tmp/ccbJBb5M.o: In functiondisplay()’:/libGLU.so.1 -lGLU
/home/roman/tmp/ccbJBb5M.o(.text+0x148): undefined reference to floor' /home/roman/tmp/ccbJBb5M.o: In functionmain’:6/lib/libGLU.so.1 -lGLU
/home/roman/tmp/ccbJBb5M.o(.text+0x4d6): undefined reference to glutInit' /home/roman/tmp/ccbJBb5M.o(.text+0x4e3): undefined reference toglutInitDisplayMode’
/home/roman/tmp/ccbJBb5M.o(.text+0x4f8): undefined reference to glutInitWindowSize' /home/roman/tmp/ccbJBb5M.o(.text+0x508): undefined reference toglutCreateWindow’
/home/roman/tmp/ccbJBb5M.o(.text+0x555): undefined reference to glutDisplayFunc' /home/roman/tmp/ccbJBb5M.o(.text+0x565): undefined reference toglutReshapeFunc’
/home/roman/tmp/ccbJBb5M.o(.text+0x56d): undefined reference to glutMainLoop' /home/roman/tmp/ccbJBb5M.o: In functionFRAME_BEGIN’:
/home/roman/tmp/ccbJBb5M.o(.eh_frame+0x11): undefined reference to __gxx_personality_v0' /usr/X11R6/lib//libGL.a(glthread.o): In function_glthread_InitTSD’:
glthread.o(.text+0x1e): undefined reference to pthread_key_create' /usr/X11R6/lib//libGL.a(glthread.o): In function_glthread_GetTSD’:
glthread.o(.text+0x6a): undefined reference to pthread_key_create' glthread.o(.text+0x9e): undefined reference topthread_getspecific’
/usr/X11R6/lib//libGL.a(glthread.o): In function _glthread_SetTSD': glthread.o(.text+0xca): undefined reference topthread_key_create’
glthread.o(.text+0x102): undefined reference to pthread_setspecific' /usr/X11R6/lib//libGLU.so: undefined reference tosqrt’
/usr/X11R6/lib//libGLU.so: undefined reference to `ceil’
collect2: ld returned 1 exit statusi run the compiling Instruction with:
gcc -o bla ZickZack.cpp -lGL -L/usr/X11R6/lib/ -lGLU
and the error occures:
What do I wrong? My friend gave me the tip, that I have to deinstall the nVIDIA Drivers, but i can´t imagine, thats the only solution for this problem.

Originally posted by Romanofski:

/home/roman/tmp/ccbJBb5M.o(.text+0x4d6): undefined reference to `glutInit’

gcc -o bla ZickZack.cpp -lGL -L/usr/X11R6/lib/ -lGLU
and the error occures:
. [/b]

Try adding -lglut for your line

No no no… i won´t compile ((((((

gcc -o test ZickZack.cpp -lGL -lglut -L./ -lGLU
/home/roman/tmp/ccaUs23t.o: In function display()': /home/roman/tmp/ccaUs23t.o(.text+0x148): undefined reference to floor’
/home/roman/tmp/ccaUs23t.o: In function __FRAME_BEGIN__': /home/roman/tmp/ccaUs23t.o(.eh_frame+0x11): undefined reference to __gxx_personality_v0’
.//libGLU.so: undefined reference to sqrt' .//libGLU.so: undefined reference to cos’
.//libGLU.so: undefined reference to `sin’
collect2: ld returned 1 exit status


Can it be, that the newer gcc is the problem?
cc -v
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.0.1/specs
Configured with: …/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-cstdio=stdio --enable-clocale=generic --enable-languages=c,c++,f77,objc,java --program-suffix=-3.0.1 --enable-objc-gc --host=i586-mandrake-linux-gnu
Thread model: posix
gcc version 3.0.1---------

It seems like you have solved all your OpenGL related link errors. Yes, I also thinks the remaining errors is because you are using the new compiler. Adding -lm should fix the math functions. Have you tried with gxx, g++ or c++ instead of gcc in the command line?

Thank god for your comment!!!1
THANKS!!!
I’m so happy!!
g++ -o test ZickZack.cpp -lGL -lglut -L./ -lGLU
THANKS!

Originally posted by Romanofski:
[b]No no no… i won´t compile ((((((

gcc -o test ZickZack.cpp -lGL -lglut -L./ -lGLU
/home/roman/tmp/ccaUs23t.o: In function display()': /home/roman/tmp/ccaUs23t.o(.text+0x148): undefined reference to floor’

Looks like error in your code ‘floor’ is not defined. maybe your forget to define it or it can be written wrongly.

/home/roman/tmp/ccaUs23t.o: In function __FRAME_BEGIN__': /home/roman/tmp/ccaUs23t.o(.eh_frame+0x11): undefined reference to __gxx_personality_v0’

do not know about this, looks like some kind of library call. or maybe some function you made.

.//libGLU.so: undefined reference to sqrt' .//libGLU.so: undefined reference to cos’
.//libGLU.so: undefined reference to `sin’
collect2: ld returned 1 exit status

math functions are in -lm


Can it be, that the newer gcc is the problem?
cc -v
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.0.1/specs
Configured with: …/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-cstdio=stdio --enable-clocale=generic --enable-languages=c,c++,f77,objc,java --program-suffix=-3.0.1 --enable-objc-gc --host=i586-mandrake-linux-gnu
Thread model: posix
gcc version 3.0.1---------[/b]

Mandrake ->, you can easily change your compiler using update-alternatives gcc

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