Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: How should i compile ?

  1. #1
    Guest

    How should i compile ?

    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

  2. #2
    Intern Newbie
    Join Date
    Sep 2001
    Location
    Helsinki, Finland
    Posts
    40

    Re: How should i compile ?

    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

  3. #3
    Guest

    Re: How should i compile ?

    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?

  4. #4
    Guest

    Re: How should i compile ?

    GOTCHA !
    thanx guyz, but anyway had to find ze correct answer to moi problemo. A friend did it what compiles -
    gcc file.c -lglut -lGL -lGLU -L/usr/X11R6/lib -lXaw -lXi -lm -o myprog
    *whew*
    that about does it thanx anywayz..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •