I have tried several ways to get GLEW working with my VS2010 project. No success. At first I tried using the pre-built libs and dlls from the website. I downloaded these pre-built files from http://glew.sourceforge.net/index.html and did something like: setting up GLEW windows?
.h files were put in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include
.lib files were put in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\x64 (I also put them one level up just in case)
glew32.dll went to C:\Windows\SysWOW64
linker->input add glew32.lib, GlU32.lib, and OpenGL32.lib to Additional Dependencies
Preprocessor definitions: put in GLEW_BUILD and GLEW_STATIC (my program needs to be a DLL but other seem to have success with the STATIC one, so I include both)
When I run the program with these settings, glewInit() is not so GLEW_OK. Even though glewInit() fails, it still recognizes that function strangely. When I use another glew function like "glCreateProgram()", I get the following errors:
Error 56 error LNK2020: unresolved token (0A000327) __glewCreateProgram
C:\Users\aab\studyWrist\Visualization\libCoin3D\ShaderHandler.obj libCoin3D
Error 57 error LNK2001: unresolved external symbol __glewCreateProgram
C:\Users\aab\studyWrist\Visualization\libCoin3D\ShaderHandler.obj libCoin3D
Error 58 error LNK1120: 2 unresolved externals
C:\Users\aab\studyWrist\Visualization\libCoin3D\Debug\libCoin3D.dll libCoin3D
So, some other suggestions on stackoverflow are to rebuild glew. So next I tried building glew32d in VS2010. I followed OpenGL: How to compile glew32.dll from source file and got glew32d.dll and glew32d.lib.
glew32d.lib put in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\x64 (the program only recognizes the lib if i put it in x64 folder, and not a level up)
glew32d.dll went to C:\Windows\SysWOW64
linker->input add glew32d.lib (this one is changed), GlU32.lib, and OpenGL32.lib to Additional Dependencies
Preprocessor definitions: put in GLEW_BUILD and GLEW_STATIC
My following errors are caused just by glewInit:
Error 56 error LNK2028: unresolved token (0A000383) "extern "C" unsigned int
__cdecl glewInit(void)" (?glewInit@@$$J0YAIXZ) referenced in function "public: __cdecl
MasterCube::MasterCube(void)" (??0MasterCube@@$$FQEAA@XZ)
C:\Users\aab\studyWrist\Visualization\libCoin3D\MasterCube.obj libCoin3D
Error 57 error LNK2019: unresolved external symbol "extern "C" unsigned int
__cdecl glewInit(void)" (?glewInit@@$$J0YAIXZ) referenced in function "public: __cdecl
MasterCube::MasterCube(void)" (??0MasterCube@@$$FQEAA@XZ)
C:\Users\aab\wristuptodate\studyWrist\Visualization\libCoin3D\MasterCube.obj
libCoin3D
Any idea what's going wrong and how I can fix it?