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: Basic installation

  1. #1
    Guest

    Basic installation

    A newbie question:

    I have just installed redhat 7.1 on my desktop. And the GL dir is found in the /usr/include. But when i try to compile the sample program, the error message said "undefined reference on "glColor"
    "undefined reference on "glVertex3f" ..............

    What's problem

    Labbit

  2. #2
    Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Vancouver BC Canada
    Posts
    418

    Re: Basic installation

    Those sound like linker problems, in which case you aren't linking properly. Something like the following:

    gcc ...... -L/usr/X11R6/lib -lGL -lGLU -lglut -lX11


    should do it (you don't need the -lglut if you aren't using glut, and -lX11 may not be necessary either). Replace ... with your own stuff.

  3. #3
    Guest

    Re: Basic installation

    It works now! So it means I need to compile all file by such a "long" command: "gcc -o file file.c -L/usr/X11R6/lib -lGL -lGLU -lglut"?
    Could i do some way shorter?

  4. #4
    Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Vancouver BC Canada
    Posts
    418

    Re: Basic installation

    Yeah.

    Use a Makefile.

    Hope this helps.

Posting Permissions

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