OpenGL X11 app
I've struggled a lot over the last few days trying to build glxgears.c and at this point I'd just like to know if people out there have some good documentation on getting an X11 OpenGL context working. # gcc -I/usr/X11R6/include -L/usr/X11R6/lib glxgears.c glxgears.c:501:2: warning: no newline at end of file /var/tmp//ccuhcfJ3.o(.text+0x74): In function `gear': : undefined reference to `glShadeModel' /var/tmp//ccuhcfJ3.o(.text+0x91): In function `gear': : undefined reference to `glNormal3f' /var/tmp//ccuhcfJ3.o(.text+0x9e): In function `gear': : undefined reference to `glBegin' /var/tmp//ccuhcfJ3.o(.text+0xf5): In function `gear': : undefined reference to `sin' /var/tmp//ccuhcfJ3.o(.text+0x11a): In function `gear': : undefined reference to `cos' /var/tmp//ccuhcfJ3.o(.text+0x12c): In function `gear': : undefined reference to `glVertex3f' /var/tmp//ccuhcfJ3.o(.text+0x159): In function `gear': : undefined reference to `sin' /var/tmp//ccuhcfJ3.o(.text+0x17e): In function `gear': : undefined reference to `cos' ... (this keeps going for some time) ... /var/tmp//ccuhcfJ3.o(.text+0x1bdb): In function `main': : undefined reference to `XCloseDisplay' Exit 1
I'm very new to the world of command line building with GCC — so if this seams simple please bear with me. =)
You didn't include the include directories for X11 and GL.
Use the -I command
Use the -I command
gcc -I/usr/X11R6/include -lX11 -lGL -lm glxgears.c
glxgears.c:501:2: warning: no newline at end of file
/usr/bin/ld: cannot find -lX11
Exit 1
glxgears.c:501:2: warning: no newline at end of file
/usr/bin/ld: cannot find -lX11
Exit 1
This got me farther, but now I think I have another problem on my hands. I take it I need libm.so.3?
gcc -I/usr/X11R6/include -L/usr/X11R6/lib -lGL -lm glxgears.c
glxgears.c:501:2: warning: no newline at end of file
/usr/bin/ld: warning: libm.so.3, needed by /usr/X11R6/lib/libGL.so, not found (t ry using -rpath or -rpath-link)
gcc -I/usr/X11R6/include -L/usr/X11R6/lib -lGL -lm glxgears.c
glxgears.c:501:2: warning: no newline at end of file
/usr/bin/ld: warning: libm.so.3, needed by /usr/X11R6/lib/libGL.so, not found (t ry using -rpath or -rpath-link)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement