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

Thread: nehe tutorial on initializing window gives error when compiled

  1. #1
    Junior Member Regular Contributor
    Join Date
    Sep 2000
    Posts
    205

    nehe tutorial on initializing window gives error when compiled

    Hi, here's the error:

    /tmp/ccodmAFC.o(.text+0x26f): undefined reference to 'glutKeyboardFunc'

    It does this for every glut and gl function in the small program. I checked to see if i had the .h files installed and they're there. Does anyone know what I can do?

  2. #2
    Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Vancouver BC Canada
    Posts
    433

    Re: nehe tutorial on initializing window gives error when compiled

    You need to link in the glut library:

    gcc .... -lglut

  3. #3
    Junior Member Regular Contributor
    Join Date
    Sep 2000
    Posts
    205

    Re: nehe tutorial on initializing window gives error when compiled

    Ok, I did that and it got rid of all the errors that had the above form with glut* functions but the errors are still there for gl* and glu* funcitons. There are different errors now that say:

    /usr/lib/libglut.so: undefined reference to 'gluQuadricNormas'

    and it looks like there is an error of this form for all the functions that start with gl and glu. I guess if i link another library it will fix all these problems. Is there something else I should link? I've been using VC++ 6 and i think it does these steps for you so thats why i'm confused.

  4. #4
    Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Greece
    Posts
    496

    Re: nehe tutorial on initializing window gives error when compiled

    Just use gcc ... -lglut -lGL -lGLU.

  5. #5
    Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Vancouver BC Canada
    Posts
    433

    Re: nehe tutorial on initializing window gives error when compiled

    Visual Crap++ didn't do anything for you... you probably used NeHe's project file which already had it specified.

    All of the NeHe tutorials I've ever downloaded came with a makefile. Why not use it instead? Just type "make".

  6. #6
    Junior Member Regular Contributor
    Join Date
    Sep 2000
    Posts
    205

    Re: nehe tutorial on initializing window gives error when compiled

    right right I tried the make file but it wouldn't work. I'll gcc with theextra options.

  7. #7
    Junior Member Regular Contributor
    Join Date
    Sep 2000
    Posts
    205

    Re: nehe tutorial on initializing window gives error when compiled

    Ok, the make file would have worked but when i saw it in the directory i thought i had to type makefile not make. SO make worked and so did compiling with the options, thanks guys.

Posting Permissions

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