Reputation: 2494
I keep getting a linker error trying to get GLEW to work in VS2012. I have searched online, and none of the solutions worked.
To set up, I added glew\include
to VC++ Include Directories, and glew\lib
to VC++ Library Directories. Both are saved in my glew library folder. I added glew32.lib to Linker:Input:Additional Dependencies. I added the glew32 DLL (glew\lib) folder added to the system path, and restarted after doing so.
Prior to this, I tried by adding the include and lib files directly into the Visual Studio install directory where it searches for them by default, with the .dll placed in System32. This solution also failed to work.
My code goes as follows:
#pragma comment(lib, "glew32.lib")
#include <GL/glew.h>
int main(){
glewInit();
}
That's it. The code fails the same regardless where I put the #pragma
, or even when I remove it completely. This gets the following error:
main.obj : error LNK2019: unresolved external symbol __imp__glewInit@0 referenced in function _main
OS: Windows 7 Ultimate 64-bit
IDE: Microsoft Visual Studio 2012 4.5.50709
GLEW: Version 1.9.0
EDIT: Right after posting this, I tried re-downloading the GLEW .zip file, and realized that I downloaded the 64-bit version. So instead, I tried downloading the 32-bit version and it works now. However, I am still confused why it didn't work with the 64-bit version, and how to get it working? It seems that nothing works when you try the 64-bit version!
Upvotes: 0
Views: 1751