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

Thread: unresolved external symbol

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    Ireland
    Posts
    15

    unresolved external symbol

    Hello there,

    I'm getting these linker errors when I compile and execute my VC++ MFC application.

    I've included the header files for OpenGL.
    I've checked all functions for correct parameter type.

    Open.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
    Open.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
    Open.obj : error LNK2001: unresolved external symbol _gluPerspective@32
    Open.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
    Open.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
    Open.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
    Open.obj : error LNK2001: unresolved external symbol __imp__glHint@8
    Open.obj : error LNK2001: unresolved external symbol __imp__glDepthFunc@4
    Open.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
    Open.obj : error LNK2001: unresolved external symbol __imp__glClearDepth@8
    Open.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
    Open.obj : error LNK2001: unresolved external symbol __imp__glShadeModel@4
    Open.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
    Open.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
    Open.obj : error LNK2001: unresolved external symbol __imp__glColor3f@12
    Open.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
    Open.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
    Open.obj : error LNK2001: unresolved external symbol __imp__glClear@4
    Debug/Gest_Rep.exe : fatal error LNK1120: 18 unresolved externals

    Any ideas whats wrong?

    Thanks in advance.

  2. #2
    Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Princeton, NJ
    Posts
    391

    Re: unresolved external symbol

    have you linked with the libraries ie
    #pragma comment(lib, "opengl32.lib")
    #pragma comment(lib, "glu32.lib")

  3. #3
    Guest

    Re: unresolved external symbol

    Perfect, thanks very much!!

  4. #4
    Guest

    Re: unresolved external symbol

    Originally posted by ToTol:
    Perfect, thanks very much!!

  5. #5
    Guest

    Re: unresolved external symbol

    There has -got- to be a better way to do this than with #pragma. Is there some standardized way to do this? Because any implementation of #pragma is, by definition, not standard...

  6. #6
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: unresolved external symbol

    chowe6685 said that you need to link the libraries. And told how to do that with MSVC++. Each linker will have its own way. With gcc under windows, add -lopengl32 -lglu32 to the command line.

Posting Permissions

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