Reputation: 383
so I have this project for my graphics class that I need to complete using C++ and OpenGL. I am using VS2013 and VC++ to complete the project. The first example we were given built successfully and ran fine. However, when we were given the code for the second project, I get a bunch of linking errors (below) where Mac and Linux computers were able to compile and run just fine. I have been through numerous blogs on and off of stack overflow, and have been unable to resolve this issue.
I've also replaced all the libraries and dlls and headers both from the pre-packaged download from the glut website, and I also compiled the source code of glut and placed the lib, dll, and header files into the correct folder and still get the same error.
The libraries here must be dynamic, they cannot be static (as per request of my professor).
The source code can be found here: https://bitbucket.org/nolanblew/cs-150-project-2/overview, and then click on "download" or you can fork it (please don't push to this repo - it will be public until this question is answered).
Here are all of the link errors I'm getting. The code compiles fine but fails on build:
Error 35 error LNK2001: unresolved external symbol ___glewVertexAttribPointer C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 34 error LNK2001: unresolved external symbol ___glewUseProgram C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 33 error LNK2001: unresolved external symbol ___glewUniformMatrix4fv C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 32 error LNK2001: unresolved external symbol ___glewUniform3f C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 31 error LNK2001: unresolved external symbol ___glewUniform1i C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 17 error LNK2001: unresolved external symbol ___glewShaderSource C:\Users\Nolan\Source\Repos\cs-150-project-2\glsupport.obj Project 2
Error 16 error LNK2001: unresolved external symbol ___glewLinkProgram C:\Users\Nolan\Source\Repos\cs-150-project-2\glsupport.obj Project 2
Error 30 error LNK2001: unresolved external symbol ___glewGetUniformLocation C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 15 error LNK2001: unresolved external symbol ___glewGetShaderiv C:\Users\Nolan\Source\Repos\cs-150-project-2\glsupport.obj Project 2
Error 14 error LNK2001: unresolved external symbol ___glewGetProgramiv C:\Users\Nolan\Source\Repos\cs-150-project-2\glsupport.obj Project 2
Error 19 error LNK2001: unresolved external symbol ___glewGetObjectParameterivARB C:\Users\Nolan\Source\Repos\cs-150-project-2\glsupport.obj Project 2
Error 18 error LNK2001: unresolved external symbol ___glewGetInfoLogARB C:\Users\Nolan\Source\Repos\cs-150-project-2\glsupport.obj Project 2
Error 29 error LNK2001: unresolved external symbol ___glewGetAttribLocation C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 24 error LNK2001: unresolved external symbol ___glewGenBuffers C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 28 error LNK2001: unresolved external symbol ___glewEnableVertexAttribArray C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 27 error LNK2001: unresolved external symbol ___glewDisableVertexAttribArray C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 13 error LNK2001: unresolved external symbol ___glewDetachShader C:\Users\Nolan\Source\Repos\cs-150-project-2\glsupport.obj Project 2
Error 12 error LNK2001: unresolved external symbol ___glewDeleteShader C:\Users\Nolan\Source\Repos\cs-150-project-2\glsupport.obj Project 2
Error 26 error LNK2001: unresolved external symbol ___glewDeleteProgram C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 23 error LNK2001: unresolved external symbol ___glewDeleteBuffers C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 11 error LNK2001: unresolved external symbol ___glewCreateShader C:\Users\Nolan\Source\Repos\cs-150-project-2\glsupport.obj Project 2
Error 25 error LNK2001: unresolved external symbol ___glewCreateProgram C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 10 error LNK2001: unresolved external symbol ___glewCompileShader C:\Users\Nolan\Source\Repos\cs-150-project-2\glsupport.obj Project 2
Error 22 error LNK2001: unresolved external symbol ___glewBufferData C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 36 error LNK2001: unresolved external symbol ___glewBindFragDataLocation C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 21 error LNK2001: unresolved external symbol ___glewBindBuffer C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 9 error LNK2001: unresolved external symbol ___glewAttachShader C:\Users\Nolan\Source\Repos\cs-150-project-2\glsupport.obj Project 2
Error 20 error LNK2001: unresolved external symbol ___glewActiveTexture C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 37 error LNK2001: unresolved external symbol ___GLEW_VERSION_2_0 C:\Users\Nolan\Source\Repos\cs-150-project-2\trans.obj Project 2
Error 38 error LNK1120: 29 unresolved externals C:\Users\Nolan\Source\Repos\cs-150-project-2\Debug\Project 2.exe Project 2
Any help would be greatly appreciated. Thanks.
Upvotes: 2
Views: 3105
Reputation: 383
Ok, well after a lot of research I found out what to do on this page: http://www.gamedev.net/topic/472791-beginner-woes-linking-solved/
Basically,
In VC++, click View>Propery Pages...
Expand Configuration Properties>Linker>Input
add glew32.lib (for example) to the Additional Dependencies box
Upvotes: 2