GLEW Communication Errors

I am trying to compile a sample GLSL program from a website so that I can feel the shaders.

An example shader program from http://www.swiftless.com/tutorials/glsl/1_setup.html#DL

1>------ Build started: Project: TheLightingExperiment2, Configuration: Debug Win32 ------ 1>shader.obj : error LNK2001: unresolved external symbol __imp____glewLinkProgram 1>shader.obj : error LNK2001: unresolved external symbol __imp____glewAttachShader 1>shader.obj : error LNK2001: unresolved external symbol __imp____glewCreateProgram 1>shader.obj : error LNK2001: unresolved external symbol __imp____glewCompileShader 1>shader.obj : error LNK2001: unresolved external symbol __imp____glewShaderSource 1>shader.obj : error LNK2001: unresolved external symbol __imp____glewCreateShader 1>shader.obj : error LNK2001: unresolved external symbol __imp____glewDeleteProgram 1>shader.obj : error LNK2001: unresolved external symbol __imp____glewDeleteShader 1>shader.obj : error LNK2001: unresolved external symbol __imp____glewDetachShader 1>shader.obj : error LNK2001: unresolved external symbol __imp____glewUseProgram 1>C:\Users\Shawn\Desktop\TheLightingExperiment2\Debug\TheLightingExperiment2.exe : fatal error LNK1120: 10 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 

It seems that the errors from glew are not related correctly. But I follow the glew documentation for the glew @ http://glew.sourceforge.net/install.html link

And it still gives me these errors. I put glew32.lib in linker-> input. I put glew32.lib in the VC lib directory and also included glew in the VC inclusion directory. From googleing, my problem seems to be the solution, but it does not work for me.

+4
source share
3 answers

Save a ton of problems and just add glew.c to your project. Make sure you are #define GLEW_STATIC and everything will be fine. You should not try to dynamically bind to GLEW.

+8
source

I ran into the same binding problem using VS.

It turned out that you should use Win32 lib instead of x64

+3
source

Build a graph using the GLEW_BUILD preprocessor directive (i.e. project parameters glew → c / C ++ → preprocessor → additional definitions)

+1
source

All Articles