Compiler Problems

I am trying to get opengl (specifically glut) to work on my computer. I downloaded the cube example problem and Makefile, and I get this problem when it tries to link

[egschaub@cfd1]# make
g++ -Wall -I/usr/X11R6/include/ -o cube -L/usr/X11R6/lib cube.o -lX11 -lXi -lXmu -lglut -lGL -lGLU -lm
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to glXBindChannelToWindowSGIX' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toglXQueryChannelDeltasSGIX’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to glXChannelRectSyncSGIX' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toglXChannelRectSGIX’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to `glXQueryChannelRectSGIX’
collect2: ld returned 1 exit status
make: *** [cube] Error 1

Anyone know how I can correct this problem.
Thanks,
Ed

P.S. Does the same if I use gcc.

You need to link with the GLX routines as well. I’m not sure exactly where you’d find these, but adding -lGLX to your link line might be a good start!