GLSL Setup

I get these errors when i try to put together a GLSL example program from a website, just so i can get a feel for shaders. I also get these exact same errors when i try to implement this shader in my own program.

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 ==========


I was told to add the shader.cpp & shader.h to my project instead of just having it in the folder, and now i get these new errors:


[FONT=Consolas][SIZE=1]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 ==========
[/SIZE][/FONT]

Did i solve the previous problem, or am i digging myself deeper?

Looks like you forgot to put glew32 in your linker.

If you’re using visual studio, you need to add it under additional dependencies.

Thank you!

I got same errors!
How did you do to fix it?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.