PDA

View Full Version : How should i compile ?



05-06-2001, 12:41 PM
I'm having major problems trying to compile an OpenGL program in Linux using gcc .
my command line is ..
gcc -o myprog file.c -lGL -lGLU -lglut -I/usr/X11R6/include -L/usr/X11R6/lib
but the thingie doesnt compile. Just gives me a LOT of undefined references from all those libraries (libGL.so, libglut.so, libGLU.so) undefined references to a hell lotta X<functions> . Someone PLEASE help me out http://www.opengl.org/discussion_boards/ubb/frown.gif

jackz
05-06-2001, 12:56 PM
Hi,

Have you checked that you have all the *.h and *.so files in your system and in path.

Best way is to get some examples with makefile. Maybe nehe.gamedev.net there are some tutorials convertedto linux also.

try compile those tutorials, if I remember right some of those need math library been added in makefiles in some distro, but they should compile ok.

if you can compile some tutorial, check what is included in makefile and make your own using that makefile as reference.


Originally posted by Alius:
I'm having major problems trying to compile an OpenGL program in Linux using gcc .
my command line is ..
gcc -o myprog file.c -lGL -lGLU -lglut -I/usr/X11R6/include -L/usr/X11R6/lib
but the thingie doesnt compile. Just gives me a LOT of undefined references from all those libraries (libGL.so, libglut.so, libGLU.so) undefined references to a hell lotta X<functions> . Someone PLEASE help me out http://www.opengl.org/discussion_boards/ubb/frown.gif

05-06-2001, 01:40 PM
I just have to do
gcc -o myprog file.c -lGL -lGLU -lglut
to compile. The GL headers are in /usr/include/GL/ and the libraries are in /usr/lib but perhaps is this depending on the distribution?

You should check that the libraries really exist and in case of symlinks that they are correct. Perhaps do you need to do a ldconfig?

05-08-2001, 09:05 AM
GOTCHA !
thanx guyz, but anyway had to find ze correct answer to moi problemo. A friend did it http://www.opengl.org/discussion_boards/ubb/smile.gif what compiles -
gcc file.c -lglut -lGL -lGLU -L/usr/X11R6/lib -lXaw -lXi -lm -o myprog
*whew*
that about does it http://www.opengl.org/discussion_boards/ubb/smile.gif thanx anywayz..