HI, i’m new to openGL.
I have a slackware 8.0 and installed the GLUT library, but i don’t have Mesa (where can i find it? is it necessary to use GLUT or not?).
I tryed to compile a program i found on the glut.column1.ps file i downloaded on opengl.org web page, and i get the followng errors:
bash-2.05$ make
gcc -c -o prova.o prova.c
gcc -o es prova.o -L/usr/X11R6/lib -L/home/galy/GLUT/glut-3.7/lib/glut -lX11 -lm -lGL -lGLU -lglut
/home/galy/GLUT/glut-3.7/lib/glut/libglut.so: undefined reference to XGetExtensionVersion' /home/galy/GLUT/glut-3.7/lib/glut/libglut.so: undefined reference to XFreeDeviceList’
/home/galy/GLUT/glut-3.7/lib/glut/libglut.so: undefined reference to XQueryDeviceState' /home/galy/GLUT/glut-3.7/lib/glut/libglut.so: undefined reference to XListInputDevices’
/home/galy/GLUT/glut-3.7/lib/glut/libglut.so: undefined reference to XFreeDeviceState' /home/galy/GLUT/glut-3.7/lib/glut/libglut.so: undefined reference to XOpenDevice’
/home/galy/GLUT/glut-3.7/lib/glut/libglut.so: undefined reference to XmuLookupStandardColormap' /home/galy/GLUT/glut-3.7/lib/glut/libglut.so: undefined reference to XSelectExtensionEvent’
Mesas homepage is at http://mesa3d.org/ but it is also included in all distributions. You already have an OpenGL library installed so you do not need Mesa. If you have a NVidia card should you use drivers from their page if not is your installed Mesa library OK.
You are missing -lXmu at your command line needed by the XmuLookupStandardColormap function. The others missing functions is in -lX11. Try to move -lglut before -lX11. Your order works for me but I can not come up with any other suggestion.
You do not have to include X11 in your GLUT programs since GLUT takes care of that.
Mesa includes GLUT but this version is easier to use because you do not need the X-libraries on the command line. You should now be able to build your program with
gcc -c -o prova.o prova.c
gcc -o es prova.o -lm -lGL -lGLU -lglut
The disadvantage is that you may have overwritten some library and no longer have direct rendering. This can be tested with the glxinfo command.
You only have to type
g++ program.c -o program name -lglut -lm
-lGL -lGLU
if you type more you will have errors if you type less you will have errors, you may use gcc