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

Thread: linker problem

  1. #1
    Guest

    linker problem

    i have an error during linking.
    it is said "unresolved external symbol" but i have put opengl32.lib glut32.lib glu32.lib
    in object/library modules,i have also copied this lib files in lib directory,glu.h.... into include dir and opengl32.dll glut32.dll glu32.dll in \windows\system\.
    thanks for your help

  2. #2
    Member Regular Contributor
    Join Date
    Nov 2000
    Posts
    409

    Re: linker problem

    And just *what* was the exact error message? It might be looking for another lib, but since you didn't specify what the actual error message was, can't really help.

  3. #3
    Guest

    Re: linker problem

    sorry
    the error is

    Linking...
    accum.obj : error LNK2001: unresolved external symbol ___glutInitWithExit@12
    accum.obj : error LNK2001: unresolved external symbol ___glutCreateWindowWithExit@8
    Debug/accum.exe : fatal error LNK1120: 2 unresolved externals
    Error executing link.exe.

    accum.exe - 3 error(s), 0 warning(s)

    thanks

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: linker problem

    That's a problem linking in glut. Make sure you put the glut32.lib file in your library path too. Since you are using glut, the glut.h will actually add the libraries to the project for you like so...

    #pragma comment(lib, opengl32.lib)
    // and the other libraries similarly...
    Deiussum
    Software Engineer and OpenGL enthusiast

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: linker problem

    Should have also mentioned that it could be a problem with having a different version of header vs. library. Since you didn't get unresolved externals on other glut functions you should have used, that is probably the case. make sure you download the latest versions. (There is a link to them from the main site somewhere.)
    Deiussum
    Software Engineer and OpenGL enthusiast

Posting Permissions

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