Results 1 to 10 of 10

Thread: How to install an API from source code? specifially GLUT

  1. #1

    Unhappy How to install an API from source code? specifially GLUT

    [Short version]

    In what directory do I need to install a tarball containing API libraries in order to import the libraries for programming?


    [Long version]

    I've been trying for a few hours now to get started on my homework - but I need the GLUT api for OpenGL. After attempting to compile a simple test program, I got the error
    Code:
    glut.h: No such file or directory
    First off, I'm not even really sure if OpenGL wasn't included in the original install or if I even need it when programming with GLUT (I truelly am clueless, lol). But after reading as much as I could, I've only been able to deduce that I need to install the API libraries somewhere on my disc...

    So I found the tarball, and there are special instructions for installing a linux machine. I found instructions saying to install it in the directory /usr/lib/ but is that right for the SUSE distro?

    Also, if anybody knows anything about GLUT/OpenGL programming + openSUSE11.2, please chim in! I'm helpless...

  2. #2

    Default Re: How to install an API from source code? specifially GLUT

    Oh, and these are the instructions I found:

    Code:
    cd /usr/src
    tar -xvzf glut-3.7.tar.gz
    cd glut-3.7
    
    Read the file: README.linux
    cd linux
    READ the file: README
    cp Glut.cf ..
    cd ..
    Edit Glut.cf: remove any Mesa references.
    Replace any -lMesaGL -lMesaGLU with -lGL -lGLU if needed.
    In particular, replace:
    OPENGL = $(TOP)/../lib/libMesaGL.so
    GLU = $(TOP)/../lib/libMesaGLU.so
    with:
    OPENGL = -lGL
    GLU = -lGLU
    
    ./mkmkfiles.imake
    cd lib/glut
    cp /usr/src/glut-3.7/linux/Makefile .
    Edit the Makefile: remove any Mesa references.
    Replace any -lMesaGL -lMesaGLU with -lGL -lGLU if needed.
    In particular, replace:
    OPENGL = $(TOP)/../lib/libMesaGL.so
    GLU = $(TOP)/../lib/libMesaGLU.so
    with:
    OPENGL = -lGL
    GLU = -lGLU
    
    make
    ln -s libglut.so.3.7 libglut.so
    ln -s libglut.so.3.7 libglut.so.3
    cp -d libglut.* /usr/lib
    cd ..
    cd gle
    # make a shared lib for libgle
    make
    gcc -shared -o libgle.so.3.7 *.o
    ln -s libgle.so.3.7 libgle.so
    ln -s libgle.so.3.7 libgle.so.3
    cp -d libgle.* /usr/lib
    cd ..
    cd mui
    # make a shared lib for libmui
    make
    gcc -shared -o libmui.so.3.7 *.o
    ln -s libmui.so.3.7 libmui.so
    ln -s libmui.so.3.7 libmui.so.3
    cp -d libmui.* /usr/lib
    
    # Install the GLUT manual pages (not included with MesaDemos)
    cd /usr/src/glut-3.7
    make SUBDIRS=man Makefile
    cd man/glut
    make install.man
    ldconfig
    
    cd ../../progs/demos/ideas
    # edit the Makefile, change OPENGL = -lGL and GLU = -lGLU
    make
    ./ideas
    # test compiling some demos
    # take a look at which libraries have to be linked (-lX11 ...) in
    # the Makefiles. Qt's tmake program available at www.troll.no
    # is a quick way to make a Makefile but you have to edit it
    # and add the -l needed.

  3. #3
    Join Date
    Jun 2008
    Location
    Natchez, MS, USA
    Posts
    518

    Default Re: How to install an API from source code? specifially GLUT

    I see GLUT in the repositories, so I am not sure why you need to install from a tarball.

    Webpin

    Are you needing a different version?
    Free Fractal Wallpapers
    http://wilsonephillips.smugmug.com

  4. #4

    Default Re: How to install an API from source code? specifially GLUT

    @ Wilson_Phillups: Thank you for that link.

    Like I had said, when I tried to compile my program it said 'GL/glut.h: No such file or directory.' And when I searched for any file with 'glut' in the name on my computer, I got no results. I assumed that GLUT was not installed.

    So the next logical step was to go and install it. When I searched with keyword 'glut' in YaST's package search, I got the same results as in the link you posted. None of those seemed like what I needed (I don't think my professor will accept freeglut or glut for haskell). So I thought that the tarball install was my only option.

    But...the makefiles where just not playing nice with SUSE and I feel like if I'm going to get GLUT working on my laptop at all, it's going to have to be one of the RPGs.

  5. #5
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,983
    Blog Entries
    14

    Default Re: How to install an API from source code? specifially GLUT

    Use rpm's first. For development you will need the -devel- packages.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  6. #6

    Default Re: How to install an API from source code? specifially GLUT

    Ok, freeglut is installed on my laptop now (or already was ), but its not set up right. /usr/include/GL does not contain the necessary Mesa and glut files.

    Can anybody point me in the right direction? I'm a puzzled penguin .

  7. #7
    palladium NNTP User

    Default Re: How to install an API from source code? specifially GLUT

    TheStallion wrote:
    > But, when I try to compile, I still get the same error. Does anybody
    > know if there is anything I need to do to set up the paths or something?



    my _guess_ is that your professor is attempting to get you to exercise
    your problem solving and or reading skills..

    coming here for easy help (in avoiding the documentation) with your
    homework will do neither, and will not help you in the long term..

    --
    palladium

  8. #8

    Default Re: How to install an API from source code? specifially GLUT

    Quote Originally Posted by TheStallion View Post
    Ok, freeglut is installed on my laptop now (or already was ), but its not set up right. /usr/include/GL does not contain the necessary Mesa and glut files.
    As mentioned above, we're not here to do your homework, but I'll be nice and assume your homework is about GL programming, and that you need a working GL installation.

    Use YaST to install glut and glut-devel packages. The former holds the libraries, the later the header files you need. The clue (and it's a general rule) is that for DIY programming with package 'foo' you also need the 'foo-devel' package.

    I looked in the 'files' list for freeglut-devel in YaST:

    freeglut.h, freeglut_ext.h, freeglut_std.h, glut.h

  9. #9

    Default Re: How to install an API from source code? specifially GLUT

    Ok thanks! I was trying to install the freeglut packages last night (via Yast) but I'm having a problem with a media path that is terminating the process.

    BTW, the homework has nothing to do with installing anything on any OS. The professor expects us to use the computer lab's machines (which run Fedora), but I thought I'd try to save myself the 30 minute walk up the hill...

  10. #10
    palladium NNTP User

    Default Re: How to install an API from source code? specifially GLUT

    TheStallion wrote:
    > but I thought I'd try to save myself the 30 minute walk up the
    > hill...


    i remember my daddy used to tell me he had walk to school..
    up hill..
    both ways. ;-)

    --
    palladium

Posting Permissions

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