PDA

View Full Version : NVidia, Glut and Rockīn Roll! :(



11-18-2001, 05:05 AM
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!!

11-18-2001, 01:04 PM
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.

11-19-2001, 04:15 AM
Hm.. this doesnīt work for me. I reinstalled the Driver and the GLX Modul, but the Linker canīt find the GLU Libary http://www.opengl.org/discussion_boards/ubb/frown.gif
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 to `glutStrokeRoman'
/home/roman/tmp/ccbJBb5M.o(.text+0x85): undefined reference to `glutStrokeCharacter'
/home/roman/tmp/ccbJBb5M.o: In function `display()':/libGLU.so.1 -lGLU
/home/roman/tmp/ccbJBb5M.o(.text+0x148): undefined reference to `floor'
/home/roman/tmp/ccbJBb5M.o: In function `main':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 to `glutInitDisplayMode'
/home/roman/tmp/ccbJBb5M.o(.text+0x4f8): undefined reference to `glutInitWindowSize'
/home/roman/tmp/ccbJBb5M.o(.text+0x508): undefined reference to `glutCreateWindow'
/home/roman/tmp/ccbJBb5M.o(.text+0x555): undefined reference to `glutDisplayFunc'
/home/roman/tmp/ccbJBb5M.o(.text+0x565): undefined reference to `glutReshapeFunc'
/home/roman/tmp/ccbJBb5M.o(.text+0x56d): undefined reference to `glutMainLoop'
/home/roman/tmp/ccbJBb5M.o: In function `__FRAME_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 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//libGLU.so: undefined reference to `sqrt'
/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.

jackz
11-19-2001, 04:30 AM
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

11-19-2001, 05:04 AM
No no no.. i wonīt compile http://www.opengl.org/discussion_boards/ubb/frown.gif((((((

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

11-19-2001, 07:52 AM
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?

11-19-2001, 12:06 PM
Thank god for your comment!!!!!!!!!!1
THANKS!!!
I'm so happy!!
g++ -o test ZickZack.cpp -lGL -lglut -L./ -lGLU
THANKS!

jackz
11-19-2001, 12:18 PM
Originally posted by Romanofski:
No no no.. i wonīt compile http://www.opengl.org/discussion_boards/ubb/frown.gif((((((

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

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