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: Bunch of linking errors: #2019

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2005
    Location
    909 Hummel Ave. Lemoyne, PA
    Posts
    11

    Bunch of linking errors: #2019

    I include these header files at the beginning of my project main.cpp:
    Code :
    #include <gl\gl.h>			// Header File For The OpenGL32 Library
    #include <gl\glu.h>			// Header File For The GLu32 Library
    #include <gl\glaux.h>		// Header File For The Glaux Library

    Code :
    Main.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
    Main.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
    Main.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
    Main.obj : error LNK2019: unresolved external symbol __imp__glHint@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
    Main.obj : error LNK2019: unresolved external symbol __imp__glDepthFunc@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
    Main.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)

    I'm sure it has to do with either me not having the opengl files I need, or if my project settings are incorrect. I'm working with Visual Studio 2005 express C++. Any ideas why this is happening?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2004
    Posts
    999

    Re: Bunch of linking errors: #2019

    You need to add opengl32.lib and glu32.lib to the linker dependencies of your project. Here's and example of how to do this in VS 2003.

    N.

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2005
    Location
    909 Hummel Ave. Lemoyne, PA
    Posts
    11

    Re: Bunch of linking errors: #2019

    Mmk, I resolved that issue, I think it's finding my dependencies now, but now I'm getting this linker error.

    LINK : fatal error LNK1104: cannot open file ';.obj'

    Any ideas on that one?
    I looked at help and it wasn't very helpful lol.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Apr 2004
    Posts
    999

    Re: Bunch of linking errors: #2019

    Maybe you put a ; character where it doesn't belong, probably in the link command...

    N.

  5. #5
    Junior Member Newbie
    Join Date
    Oct 2005
    Location
    909 Hummel Ave. Lemoyne, PA
    Posts
    11

    Re: Bunch of linking errors: #2019

    Fixed the dependency issues, but now I have a question, If my project was already set as a precompiled header, will I be able to use win_main

    I'm getting an error:

    MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Apr 2004
    Posts
    999

    Re: Bunch of linking errors: #2019

    Google is your friend

    N.

Posting Permissions

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