I tried several ways to get GLEW to work with my VS2010 project. No success. At first, I tried using pre-created libraries and DLLs from the website. I downloaded these pre-created files from http://glew.sourceforge.net/index.html and did something like: setting up GLEW windows?
.h were placed in C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Include
.lib files were placed in C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Lib \ x64 (I also put them on one level just in case)
glew32.dll switched to C: \ Windows \ SysWOW64
linker-> add add glew32.lib, GlU32.lib and OpenGL32.lib for additional dependencies
Preprocessor definitions: enter GLEW_BUILD and GLEW_STATIC (my program should be a DLL, but others seem to be successful with STATIC, so I include both)
When I run the program with these settings, glewInit () is not that GLEW_OK. Although glewInit () fails, it still recognizes this function strangely. When I use another glew function, such as "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 stackoverflow suggestions are to rebuild glew. So I tried to build glew32d in VS2010. I followed OpenGL: how to compile glew32.dll from the source file and got glew32d.dll and glew32d.lib.
put glew32d.lib in C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Lib \ x64 (the program only recognizes lib if I put it in the x64 folder and not the level up)
glew32d.dll switched to C: \ Windows \ SysWOW64
linker-> input add glew32d.lib (this one changed), GlU32.lib and OpenGL32.lib for additional dependencies
Preprocessor Definitions: Enter GLEW_BUILD and GLEW_STATIC
My following errors are caused only 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 goes wrong and how can I fix it?
source share