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

Thread: Opengl - linker errors

  1. #1
    Intern Contributor
    Join Date
    Mar 2012
    Posts
    50

    Opengl - linker errors

    While attempting to incorporate shaders for PPL, i think i accidently removed a few includes and now my program wont run even with commenting out all the glsl code and reverting back to my original program.

    The errors:
    Code :
    1>main.obj : error LNK2019: unresolved external symbol __imp__glutSwapBuffers@0 referenced in function "void __cdecl drawScene(void)" (?drawScene@@YAXXZ)
    1>main.obj : error LNK2019: unresolved external symbol __imp__glutTimerFunc@12 referenced in function "void __cdecl update(int)" (?update@@YAXH@Z)
    1>main.obj : error LNK2019: unresolved external symbol __imp__glutPostRedisplay@0 referenced in function "void __cdecl update(int)" (?update@@YAXH@Z)
    1>main.obj : error LNK2019: unresolved external symbol __imp__glutMainLoop@0 referenced in function _main
    1>main.obj : error LNK2019: unresolved external symbol __imp__glutReshapeFunc@4 referenced in function _main
    1>main.obj : error LNK2019: unresolved external symbol __imp__glutKeyboardFunc@4 referenced in function _main
    1>main.obj : error LNK2019: unresolved external symbol __imp__glutDisplayFunc@4 referenced in function _main
    1>main.obj : error LNK2019: unresolved external symbol __imp__glutCreateWindow@4 referenced in function _main
    1>main.obj : error LNK2019: unresolved external symbol __imp__glutInitWindowSize@8 referenced in function _main
    1>main.obj : error LNK2019: unresolved external symbol __imp__glutInitDisplayMode@4 referenced in function _main
    1>main.obj : error LNK2019: unresolved external symbol __imp__glutInit@8 referenced in function _main
    1>C:\Users\Shawn\Documents\New folder\First Project - visual\Light\Debug\Light.exe : fatal error LNK1120: 11 unresolved externals

    They appear to be glut errors, but beyond that im not sure.

    I tried to backtrack and figure what i did wrong. So i'll name off the things i currently have in my program and whether or not i changed them while trying to get my shader to work.

    Includes: (I did remove 1 or 2 that may have caused these errors)
    Code :
    C:\Users\Shawn\Documents\New folder\First Project - visual\Light\Light\glew\include
    C:\Users\Shawn\Documents\New folder\First Project - visual\Light\Light\cwc\include
    C:\Users\Shawn\Documents\New folder\First Project - visual\Light\Light\freeglut\include
    C:\Program Files %28x86%29\Microsoft Visual Studio 10.0\VC\include

    Linkers:(Never touched)
    Code :
    SOIL.lib glu32.lib opengl32.lib

    And the includes in my program:
    Code :
    #include <stdlib.h>
    #include <gl/glut.h>
    #include <SOIL.h>
    #include <string>
    #include <iostream>

    I would greatly appreciate help!

  2. #2
    Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    325

    Re: Opengl - linker errors

    Shouldn't glut be in the list of libs to link to?

  3. #3
    Intern Contributor
    Join Date
    Mar 2012
    Posts
    50

    Re: Opengl - linker errors

    Naw, i never touched the linkers since it originally worked. And im not sure but i think glu32 includes glut.

  4. #4
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,256
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  5. #5
    Intern Contributor
    Join Date
    Mar 2012
    Posts
    50

    Re: Opengl - linker errors

    I'v seen that webpage before but it didn't help me

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    7

    Re: Opengl - linker errors

    Hi,

    This error is most likely not related to your #includes.

    The "unresolved external symbol" means that your compiler cannot find that function in any of the libraries you currently link with. Since all the missing functions appear to be from glut, it seems you are not linking correctly with it. This guide might help you get started with glut:

    http://www.divms.uiowa.edu/~cwyman/c...o/winGLUT.html

  7. #7
    Intern Contributor
    Join Date
    Mar 2012
    Posts
    50

    Re: Opengl - linker errors

    I moved some files around and it looks like i'v solved it, thanks guys!

  8. #8
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    1

    Re: Opengl - linker errors

    Quote Originally Posted by EthanIowa
    Hi,

    This error is most likely not related to your #includes.

    The "unresolved external symbol" means that your compiler cannot find that function in any of the libraries you currently link with. Since all the missing functions appear to be from glut, it seems you are not linking correctly with it. This guide might help you get started with glut:

    http://www.divms.uiowa.edu/~cwyman/c...o/winGLUT.html
    thanks a lot for the web page link.including some lib to my project list solved the problem of link errors really helped me out.

Posting Permissions

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