Compiling using unix shell ssh

Hi,

I’m having trouble compiling when I ssh into a unix shell. The command I’m using is: gcc -lglut -lGLU -lGL test.c. I get these errors: /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/…/…/…/libglut.so: undefined reference to XGetExtensionVersion' /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libglut.so: undefined reference toXFreeDeviceList’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/…/…/…/libglut.so: undefined reference to XQueryDeviceState' /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libglut.so: undefined reference toXListInputDevices’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/…/…/…/libglut.so: undefined reference to XFreeDeviceState' /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libglut.so: undefined reference toXOpenDevice’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/…/…/…/libglut.so: undefined reference to XmuLookupStandardColormap' /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libglut.so: undefined reference toXSelectExtensionEvent’
collect2: ld returned 1 exit status
.

Does anyone know what I’m doing wrong, do I need to add a library or something? THanks in advance.

You need to link the X libs as well. Try:

gcc -lglut -lGLU -lGL -lXmu -lX11 test.c

For further question you should try the “OpenGL on Linux” board on this site.