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

Thread: OpenGL/GLUT programming - gl.h and glu.h file locating

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2004
    Posts
    4

    OpenGL/GLUT programming - gl.h and glu.h file locating

    I'm trying to set up my Linux (RedHat9.0) box so I can program some OpenGL on it, using cc and/or gcc. But I have errors that the compilers can find the gl.h and glu.h files that are to be included.

    I found the most help so far in the "OpenGL library installation" thread, which someone was nice enough to tell me how to find the gl.h file with a find '/usr -name gl.h' which found it in '/usr/share/doc/NVIDIA_GLX-1.0/include/GL/gl.h'

    First, is this the right place to find this file? Second, I couldn't locate glu.h, where can I get this? And why in the hell is this so hard to find/setup??

    Help would be appreciated, and I'm really hoping I'm not the only one with this confusion.

    Thanks all.

    -The Dude

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: OpenGL/GLUT programming - gl.h and glu.h file locating

    The gl headers are in /usr/include/GL, -I is your friend.

    This document describes where header files should go:
    http://oss.sgi.com/projects/ogl-sample/ABI/#4

    This ABI specification is a critical document for Linux OpenGL developers. Refer to it and spread the word. Most of the questions around here seem to relate to it.

    It's not hard, it's easy, but getting your hands on the right documentation helps.

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2004
    Posts
    4

    Re: OpenGL/GLUT programming - gl.h and glu.h file locating

    the gl headers weren't in that folder though. I was able to find gl.h in my NVIDIA driver installation, but not glu.h. glu.h is no where on my computer, which is my problem. I don't know where to get it from, as I haven't found one link anywhere to the file or a package/distrobution of some sort that includes it. Thanks for the help, all of this is getting pretty frustrating.

  4. #4
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: OpenGL/GLUT programming - gl.h and glu.h file locating

    OK, you should get your glu libs and header files from here, it's probably not a bad place for a standard gl.h also:
    http://oss.sgi.com/projects/ogl-sample/

    Instead of using a proprietary .h file get the standard extension header file from here:
    http://oss.sgi.com/projects/ogl-sample/sdk.html

    Include that in addition to the standard .h to expose your extensions (and mainly to enummerate tokens). The getprocaddress or extension string checking will let you do runtime checking of functions than may not be available. It should be inclusive anyway with the added advantage that it'll work on a number of cards & drivers to expose all the registered extensions.

    Maybe gl.h and glu.h should also be in the SDK page although I think there's the assumption that they're easier to come by and are best shipped with defs contemporaneous with your drivers and their supported gl version. So maybe the nv gl.h is the right thing if it's created correctly and maybe you could also include the glext.h, that's how it should work in theory.

    Finally place all the header files in /usr/include/GL/ then you'll be ABI compliant when building your project and it should be futureproof in addition to being compatible with correctly configured development environments.

    Hmm, seems like there's an FAQ needed on this item. "Creating a Kosher Linux OpenGL SDK". Something tells me it should be easier than this.

    The distro builder should really be doing this (and the drivers/SDKs from the card makers and other package builders playing nicely with the distros).

    IMHO :-)

    [This message has been edited by dorbie (edited 01-21-2004).]

  5. #5
    Junior Member Newbie
    Join Date
    Jan 2004
    Location
    Norway
    Posts
    9

    Re: OpenGL/GLUT programming - gl.h and glu.h file locating

    You could always try download the mesa3d lib, but i would try to find the files using:
    find / | grep gl.h

    And, don't put the files in /usr/include/GL
    they shall be in /usr/X11R6/include/GL

    This is for the linux filesystem layout

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

    Re: OpenGL/GLUT programming - gl.h and glu.h file locating

    If you're using RedHat then there must be RPMs sitting on your distro CD.

    No distro worth its weight would not include something like this.

  7. #7
    Junior Member Newbie
    Join Date
    Jan 2004
    Posts
    4

    Re: OpenGL/GLUT programming - gl.h and glu.h file locating

    So, I've found the file I need, but am now having compile errors due to library bizzareness.

    here's the command and output crap:
    cc -g teapot.c -lglut -lGLU -lGL -lXmu -LXext -lX11 -lm -o teapot
    /usr/bin/ld: cannot fine -lXmu
    collect2: ld returned 1 exit status
    make: *** [teapot] Error 1

    I have checked and my /etc/ld.so.conf has /usr/x11R6/lib in it, and the libXmu files are in that folder, so anyone know what gives? man, what a headache this all is.

    Thanks guys for all the help so far!

    PS:i have to use cc, part of the parameters that were required for this project

  8. #8
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: OpenGL/GLUT programming - gl.h and glu.h file locating

    How about using -L to add link dirs and watch the case sensitivity in the library paths, this ain't windows.

    P.S. you also have a -L instead of -l for Xext on the command line you posted.

    [This message has been edited by dorbie (edited 01-22-2004).]

  9. #9
    Guest

    Re: OpenGL/GLUT programming - gl.h and glu.h file locating

    cc -g teapot.c -L/usr/X11R6/lib -lglut -lGLU -lGL -lXmu -LXext -lX11 -lm -o teapot

Posting Permissions

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