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: HELP: I can't get passed step1!

  1. #1

    HELP: I can't get passed step1!

    Greetings.

    I'm getting link errors.
    I'm running cygwin, downloaded a few days ago, so it's gcc 3.2.3

    Source Code: prog.C
    #include <GL/glut.h>
    int main(int argc, char** argv)
    {
    glutInit (&argc, argv) ;

    return 0 ;
    }

    compiled with:
    gcc -lglui -L/lib/w32api -o prog.exe prog.C

    Result:
    Temp/ccCh0KDT.o(.text+0x2c) rog.C: undefined reference to `_glutInit@8'

    I have confirmed that the string "_glutInit@8" appears in /lib/w32api/libglui.a

    So why does the Linking fail??????

    help

    [This message has been edited by The_Dj (edited 06-06-2003).]

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2003
    Location
    ames, IA, USA
    Posts
    5

    Re: HELP: I can't get passed step1!

    i would have compiled with something like
    g++ prog.C -o exe -L/lib/w32api -lglui prog.exe

    instead of:
    gcc -lglui -L/lib/w32api -o prog.exe prog.C

    it just looks like your compile fields are mixed up. learning how to use gmake by creating a Makefile may help you remember compiling rules.

    hope this helps,
    -rufeo
    cheers

  3. #3

    Re: HELP: I can't get passed step1!

    Thanks for the reply, but:

    swapping the order of the parameters has made no difference.

    I normally do use a Makefile, but I didn't want to complicate the question.

    Dj.

  4. #4
    Junior Member Newbie
    Join Date
    Jun 2003
    Location
    ames, IA, USA
    Posts
    5

    Re: HELP: I can't get passed step1!

    oops!
    i should know my compile rules!

    g++ code.C -o name.exe -L{libPath} -l{libName}

    nothing should come after the library name.
    cheers

  5. #5

    Re: HELP: I can't get passed step1!

    Yeah, I figured that. :-P

  6. #6
    Junior Member Newbie
    Join Date
    Jun 2003
    Location
    ames, IA, USA
    Posts
    5

    Re: HELP: I can't get passed step1!

    and now for the obvious solution:

    don't link glui ! link glut!

    path = {?}
    name = -lglut

    sorry i missed it.
    -pantheman
    cheers

  7. #7

    Re: HELP: I can't get passed step1!

    Linking glu32 solved that.

    But now I'm getting others as I add more code.

    I'll look into what extras I need for them before posting here again.

    Thanks for the help.

  8. #8

    Re: HELP: I can't get passed step1!

    Yup. Working.

    Odd, this, I tried linking to most libraries that seemed right, including these.

    I think my final solution was changing the order of switches in my Makefile as well as choosing the right libs.

    Live & learn.

  9. #9
    Junior Member Newbie
    Join Date
    Jun 2003
    Location
    ames, IA, USA
    Posts
    5

    Re: HELP: I can't get passed step1!

    glut is the lib you actually need.

    if you don't have it already (not a standard lib) then search with google for it and you will probably find Nate Robbins name attached. he should have any win32 libs precompiled with a readme about how to install. i don't know if the rules will apply with cygwin, but to make things easy, put any libs where your glui lib is and use the same path. you may need to do the same with the glut's header file.
    cheers

Posting Permissions

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