Results 1 to 7 of 7

Thread: mesa on linux

  1. #1
    Junior Member Newbie
    Join Date
    May 2000
    Location
    Davis,CA,USA
    Posts
    20

    mesa on linux

    I installed mesa 2.6 in my linux 5.2, the headers files are in
    /usr/include/GL/* (including gl.h, glu.h, glut.h, etc)
    but when I am making a sample program to test GL, using the command

    gcc a.c

    the compiler says:
    /tmp/cca002661.0:In function 'main'
    /tmp/cca002661.0 (.text+0xc); undefined reference to 'glutInit').
    /tmp...... (same thing repeated) (whatever glut func.
    .
    .
    .
    what is the problem? what can I do?
    From Alan.
    From Alan.

  2. #2

    Re: mesa on linux

    Where abouts are the GL LIB's ?, or whatever the linux equivalent is? I usually get that error when a compiled function cannot be found, sorta like not linking opengl32.lib when making a win32 openGL app.

    Sorry if you've already checked for this, but some answers are so simple its easy to just overlook them

  3. #3
    Junior Member Newbie
    Join Date
    May 2000
    Location
    Annapolis, MD
    Posts
    20

    Re: mesa on linux

    drakaza is right. You need to include the GL libraries on your compile (accually link) line.

    you want to do something like
    gcc a.c -L/usr/local/Mesa-2.6/lib -lGL -lGLU -lglut


    that should clear it up for you.


    -Marrcke

    [This message has been edited by Marrcke (edited 06-24-2000).]

  4. #4
    Guest

    Re: mesa on linux

    I just did the same thing as alan, but with with the above command line and I added:

    -O -o hello

    but I get the following error
    ./hello: error in loading shared libraries: libGL.so.1 cannot open shared object file: No such file or directory

    I should also comment that this error occurs after compiling, linking, when I try to ./hello

  5. #5
    Guest

    Re: mesa on linux

    > ./hello: error in loading shared libraries: libGL.so.1 cannot open shared
    > object file: No such file or directory

    this means that it can't find the library at execution time.
    That's controled by /etc/ld.so.conf. You need to add the location of the
    libGL.so.1 to that list and run ldconfig. I always delete /etc/ld.so.cache
    before I run ldconfig, but I'm pretty sure that's not necessary.

    -Marrcke
    Marc Meyer

  6. #6
    Junior Member Newbie
    Join Date
    May 2000
    Location
    Davis,CA,USA
    Posts
    20

    Re: mesa on linux

    I solved my problem earlier, but using not good way.
    I code my program in the demos directory, add the simbol in that directory's makefile.
    then "make linux". the makefile there will help you to use the approprieate command to compile. and it works!
    but I took at look at the makefils and make-config, there are so many options for compiling, even only in linux. can anyone help me to point out which one is useful and which one is not? what shall I do? copy the exactly makefile to my own directory, or what else?
    thankx.
    From Alan.
    From Alan.

  7. #7
    Senior Member Regular Contributor
    Join Date
    Mar 2000
    Location
    Aurora, Illinois, USA
    Posts
    192

    Re: mesa on linux

    eh? I usually use

    g++ code.c -O -lGL -lGLU -lglut -o code

    don't worry about the other options =D

    then just do ./code
    Navreet Gill [img]/forum/images/%%GRAEMLIN_URL%%/smile.gif[/img]

Similar Threads

  1. how to compile and link C with Mesa on Linux?
    By tonycq2001 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-07-2004, 02:38 PM
  2. how to compile and link C with Mesa on Linux?
    By tonycq2001 in forum OpenGL: Linux
    Replies: 1
    Last Post: 11-07-2004, 09:03 AM
  3. mesa and linux
    By lee in forum OpenGL: Linux
    Replies: 1
    Last Post: 06-27-2001, 03:02 PM
  4. a few linux/mesa questions (newbe)
    By jmg in forum OpenGL: Linux
    Replies: 12
    Last Post: 03-15-2001, 09:18 AM
  5. 2 voodoo2 under linux with opengl/mesa 3
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 12-26-2000, 05:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean