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

Thread: LNK2019 errors with Visual C++ 2010 Express

  1. #1
    Junior Member Newbie
    Join Date
    May 2014
    Posts
    4

    LNK2019 errors with Visual C++ 2010 Express

    I have a Win 7, 64-bit Win computer and am following the Guide to installing OpenGL for Windows, through the download section of www.sumantaguha.com. I installed Visual C++ 2010 Express, glew, freeglut and glext.h files in the suggested places. I am now getting LNK2019 errors.
    I added glew32.lib, glew32s.lib, and freeglut.lib to the Linker Additional Dependencies. For the Linker Additional Library Directories I added the following, both separately and together, believing that maybe the %28x86%29 was a problem.
    C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib
    C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Lib
    I then tried placing copies of the glew32.lib, glew32s.lib, and freeglut.lib in the project directory and the debug subdirectory.
    The following is a section of the code, followed by the error messages.

    I would like some help getting started. Thanks.

    ///////////////////////////////////
    // square.cpp
    //
    // OpenGL program to draw a square.
    //
    // Sumanta Guha.
    ///////////////////////////////////

    #ifdef __APPLE__
    # include <GL/glew.h>
    # include <GL/freeglut.h>
    # include <OpenGL/glext.h>
    #else
    # include <GL/glew.h>
    # include <GL/freeglut.h>
    # include <GL/glext.h>
    #pragma comment(lib, "glew32.lib")
    #endif

    // Drawing routine.
    void drawScene(void)

    1>------ Build started: Project: Starting_square, Configuration: Debug Win32 ------
    1> my_square.cpp
    1>my_square.obj : error LNK2019: unresolved external symbol __imp__glutMainLoop@0 referenced in function _main
    1>my_square.obj : error LNK2019: unresolved external symbol __imp__glutKeyboardFunc@4 referenced in function _main
    SNIP

    referenced in function _glutInit_ATEXIT_HACK@8
    1>C:\Users\JCR\AAA_JCR\VS_2010_Express\Starting_sq uare\Debug\Starting_square.exe : fatal error LNK1120: 10 unresolved externals
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  2. #2
    Junior Member Newbie
    Join Date
    May 2014
    Posts
    6
    Where is your glew.lib? that should be is you project directory under you project Linker input

  3. #3
    Junior Member Newbie
    Join Date
    May 2014
    Posts
    4
    Thanks for the suggestion!
    In Visual C++ 2010 Express, when I changed the Linker Additional Library Directories to the parent directory \lib, rather than \lib\Release\Win32 which actually contains glew.lib, I was able to get the Build to succeed. Unfortunately, when I run the executable I get the following message box appearing "Square.exe - Entry Point Not Found. The procedure entry point glewInit could not be located in the dynamic link library glew32.dll." I had placed a copy of glew32.dll in the same directory as the executable. I am using glew-1.10.0

    More suggests for the next step are very welcome!

Posting Permissions

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