PDA

View Full Version : Compiling using unix shell ssh



01-13-2005, 03:41 PM
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 to `XFreeDeviceList'
/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 to `XListInputDevices'
/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 to `XOpenDevice'
/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 to `XSelectExtensionEvent'
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.

01-13-2005, 11:48 PM
You need to link the X libs as well. Try:

gcc -lglut -lGLU -lGL -lXmu -lX11 test.cFor further question you should try the "OpenGL on Linux" board on this site.