I’m new to OpenGL. I tried to compile a simple GLUT program on AIX with the following command :
cc -o test test.c -I/usr/local/include/GL -L/usr/local/lib/libglut.a -lglut -lGL -lGLU
I get an error :
I/O error (-lglut): No such file or directory
even though I’ve checked the paths. I’m probably making a really dumb mistake somewhere. Would greatly appreciate it if anyone can help. Thanks.
You need to check you understand what “-L” does!
The arg to -L is the path where the library files live … not to the file itself!
The -l option specifies the actual library by prepending “lib” … so, -lglut will make the link/loader look for libglut.a (or .so etc)
-L/usr/local/lib means search the directory specified …
Note, you have specified the library in your -L option … look closely
You may also need to add
-lXmu -lXext -lX11 -lm
to your command line as well … inorder to pick up the X libraries, and hopefully they will be in one of your standard paths and not need to give another -L option! (Don’t know AIX, but IRIX, Solaris, Linux ok)
Thanks for the help. I had tried using -L/usr/local/lib before, but it gave me a different error. Anyway, I tried the same thing on a different machine(adding the -lX* options) and it compiles fine now.
Only problem now is when I run it :
OpenGL GLX extension not supported by display.
I’m using Exceed to connect to a remote host. Is the problem just a matter of setting the display environment variable on the host?
You can’t using basic eXceed!
You need to be running an Xserver which supports GLX (the OpenGL extensions). You can get eXceed 3D which supports some GLX, but this does cost a lot more money.
Going to a Linux based system where the latest Xservers do support GLX to some extent would probably be the answer. You need to ask about this in e.g. the OGL on Linux part of this forum - I am not a linux user per se.