Results 1 to 3 of 3

Thread: Suse doesn't Compile for OpenGL!

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2005
    Location
    California
    Posts
    4

    Suse doesn't Compile for OpenGL!

    I would love to see anyone compile the simple openGL program below
    without having problems under Suse. I've had no problems compiling under
    Redhat and Mandrake. Can it be done with suse?

    1) Someone try to compile this under there version of SUSE.
    2) If successful, what had to be changed? Using gcc, what did you
    type to compile it?

    //begin------: opengltest.c
    #include
    #include
    #include

    main(int argc, char *argv[])
    {
    glutInit(&argc, argv);
    return 0; /* ANSI C requires main to return int. */
    }
    //end opengltest.c

    I get:
    gcc -lm -lGL opengltest.c
    /tmp/ccAdiovA.o(.text+0x1: In function `main':
    : undefined reference to `glutInit'
    collect2: ld returned 1 exit status

    On my system:
    ../ldconfig -p | grep glut
    libglut.so.3 (libc6,x86-64) => /usr/lib64/libglut.so.3
    libglut.so.3 (libc6) => /usr/lib/libglut.so.3

    On my System:-------------------------------------------------
    > 3Ddiag
    3Ddiag version 0.722
    Verifying 3D configuration:
    Using 3dinfo
    ************************************************** **********

    ================================================== ==============
    No 3D capable graphic chipset found!
    ================================================== ==============

    Checking GL/GLU/glut runtime configuration:
    GL/GLU ... done (package xorg-x11-Mesa)
    glut ... done (package freeglut)

    How do i compile the above program (opengltest.c)?

    Thanks,
    Jason

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2004
    Location
    Angers, France
    Posts
    245

    Re: Suse doesn't Compile for OpenGL!

    Hi Jason, you should better ask your question in the forum OpenGL under Linux,

    I have a SuSE too, but i didn't use it for dev, I remember that GCC isn't installed at starting, is it right ? So maybe there is some mistakes in packages installation, have you tried to compile a simple program without GL features ? I guess yes

    Have you installed your graphic driver ? Is it working fine without crappy response ?

    I see that you have included GL header, and normally you have included glut header too, you have specified the GL lib to the compiler, but have you specified glut library ? Something like -lglut...

    That can explain why your compiler said "undefined reference to glutInit", because you use a glut function and you didn't give the lib to GCC, he don't know where glut is coming (:

    I don't know if a simple glut program without reshape can work.. and I wonder why there is "no 3D chipset blahblah", because error certainly come from glut lib

    anyway, hope that helps
    Gollum
    The .Product will make you .Believe

  3. #3
    Junior Member Newbie glBug's Avatar
    Join Date
    Oct 2004
    Location
    Canberra, ACT
    Posts
    29

    Re: Suse doesn't Compile for OpenGL!

    The compile command you used does not say the linker
    to link with libglut.so. Try to add -lglut :
    gcc opengltest.c -lGL -lglut -lm

    it is simple, if say in future you are going to use functions from some oter library, say libCrap.so or
    libabc.so you will have to tell that the linker with -lCrap or -labc , given that the libCrap.so or libabc.so are in locations known to Mr.linker if not
    you will have to specify that info as well with -L/path/to/wherever/is/libcrap/installed .

Similar Threads

  1. Replies: 2
    Last Post: 08-14-2012, 05:58 AM
  2. Project doesn't compile with include <glm/glm>
    By marek-knows.com in forum OpenGL: General
    Replies: 3
    Last Post: 12-20-2011, 04:53 PM
  3. Replies: 0
    Last Post: 09-04-2011, 04:30 AM
  4. Suse doesn't Compile for OpenGL!
    By jasonslife in forum OpenGL: Linux
    Replies: 6
    Last Post: 03-06-2005, 08:59 PM
  5. Suse doesn't Compile for OpenGL!
    By jasonslife in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 03-06-2005, 02:22 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