我试图从一个网站上整理一个 GLSL 示例程序,这样我就可以对着色器有所了解。
着色器示例程序来自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 ==========
错误似乎来自 glew 未正确链接。但是我按照 glew 的文档链接 glew @ http://glew.sourceforge.net/install.html
它仍然给我这些错误。我已将glew32.lib放入链接器->输入中。我已经把glew32.lib放到了VC lib 目录下,还有glew 包含在VC 的include 目录下。从谷歌搜索我的问题,这似乎是解决方案,但它对我不起作用。