0

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 ========== 
4
  • did you use the Shader class used in the tutorial? Commented Aug 26, 2012 at 17:05
  • did you add the Shader.cpp file to your project (not just the same folder) as well? Commented Aug 26, 2012 at 18:03
  • I didn't, but now i did and got these new errors: __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 Commented Aug 26, 2012 at 18:07
  • Did i solve the previous problem, or dig myself deeper? Commented Aug 26, 2012 at 18:13

2 Answers 2

1

These are undefined reference errors. from the Linker.You didn't attach the libraries. as you are in Visual Studio you can do this by right clicking on your Solution and thenby going to Properties.

Sign up to request clarification or add additional context in comments.

1 Comment

What libraries though? The shader doesn't have any libraries
0

It looks like you are missing libraries. Look into GLEW the GL Extension Wrangler and link that into your project. It is especially helpful with making shader extensions work.

GLEW Page

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.