当我尝试从网站上整理一个 GLSL 示例程序时,我得到了这些错误,这样我就可以对着色器有所了解。当我尝试在我自己的程序中实现这个着色器时,我也会遇到这些完全相同的错误。
http://www.swiftless.com/tutorials/glsl/1_setup.html#DL
>------ Build started: Project: TheLightingExperiment2, Configuration: Debug Win32 ------
1> main.cpp
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Shader::init(char const *,char const *)" (?init@Shader@@QAEXPBD0@Z) referenced in function "void __cdecl init(void)" (?init@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Shader::unbind(void)" (?unbind@Shader@@QAEXXZ) referenced in function "void __cdecl display(void)" (?display@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Shader::bind(void)" (?bind@Shader@@QAEXXZ) referenced in function "void __cdecl display(void)" (?display@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall Shader::Shader(void)" (??0Shader@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'shader''(void)" (??__Eshader@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall Shader::~Shader(void)" (??1Shader@@QAE@XZ) referenced in function "void __cdecl `dynamic atexit destructor for 'shader''(void)" (??__Fshader@@YAXXZ)
1>C:\Users\Shawn\Desktop\TheLightingExperiment2\Debug\TheLightingExperiment2.exe : fatal error LNK1120: 5 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========