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 6 of 6

Thread: compiling opengl and glut

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    5

    compiling opengl and glut

    im trying tocompile opengl and glut under linux, but i can't

    gcc -L/usr/lib -I/usr/include -lGLU -lglut prueba.c -o prueba.o

    what is the right way to do so?

    thanks!!

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,096

    Re: compiling opengl and glut

    You for got to include the most important library of all.... the openGL library! the other two are helper library's.

    link the following:
    -lGL -lGLU -lglut


    I have a couple of glut examples for linux posted on my website:
    www.angelfire.com/linux/nexusone/


    Originally posted by fran24:
    im trying tocompile opengl and glut under linux, but i can't

    gcc -L/usr/lib -I/usr/include -lGLU -lglut prueba.c -o prueba.o

    what is the right way to do so?

    thanks!!

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    5

    Re: compiling opengl and glut

    gcc -L/usr/lib -I/usr/include -lGL -lGLU -lglut prueba.c -o prueba.o

    ERROR:
    /usr/lib/libglut.so: undefined reference to `glXBindChannelToWindowSGIX'
    /usr/lib/libglut.so: undefined reference to `glXCreateContextWithConfigSGIX'
    /usr/lib/libglut.so: undefined reference to `glXGetFBConfigAttribSGIX'
    /usr/lib/libglut.so: undefined reference to `XGetExtensionVersion'
    /usr/lib/libglut.so: undefined reference to `XFreeDeviceList'
    /usr/lib/libglut.so: undefined reference to `XQueryDeviceState'
    /usr/lib/libglut.so: undefined reference to `XListInputDevices'
    /usr/lib/libglut.so: undefined reference to `glXQueryChannelDeltasSGIX'
    /usr/lib/libglut.so: undefined reference to `glXChannelRectSyncSGIX'
    /usr/lib/libglut.so: undefined reference to `glXChannelRectSGIX'
    /usr/lib/libglut.so: undefined reference to `XFreeDeviceState'
    /usr/lib/libglut.so: undefined reference to `XOpenDevice'
    /usr/lib/libglut.so: undefined reference to `glXQueryChannelRectSGIX'
    /usr/lib/libglut.so: undefined reference to `glXGetFBConfigFromVisualSGIX'
    /usr/lib/libglut.so: undefined reference to `XmuLookupStandardColormap'
    /usr/lib/libglut.so: undefined reference to `XSelectExtensionEvent'

    it doesn't find glx library, any idea?

    thanks!!!

  4. #4
    Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    377

    Re: compiling opengl and glut

    Originally posted by fran24:

    it doesn't find glx library, any idea?
    thanks!!!
    1. Idea: stop cross posting, once is enough
    2. Idea: it DOES find glx, i am very sure
    3. Idea: read other threads in this forum and you will find the solution to your problem
    4. Idea: try the search function of this forum before posting a new thread

    hope this helps

  5. #5
    Member Regular Contributor
    Join Date
    Mar 2002
    Location
    Vancouver
    Posts
    314

    Re: compiling opengl and glut

    I think I've answered this question about 10 times in the last month. Look through the archives.

  6. #6
    Intern Newbie
    Join Date
    Apr 2002
    Posts
    30

    Re: compiling opengl and glut

    I compile all of my glut programs like this
    g++ something.c -o something -lGL -lGLU -lglut -lm

Posting Permissions

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