0

I'm beginning my OpenGl course and I'm using the book by Edward Angel, Interactive Computer Graphics. In the first example in the book he uses glsl shaders. I have successfully linked all compiler libraries to correct compiler flags etc.

Im stuck with error message undefined reference to 'Angel :: InitShader(char const*, char const*)' Im using code::blocks as IDE on Linux Fedora 20.

If I trace the error then it's refering to GLuint program = InitShader( "vshader21.glsl", "fshader21.glsl" );

the files vshader21.glsl and the other file are in my source folder so it defenitely knows about is.

In the header file angel.h the shader files are initialized under the namespace Angel.

GLuint InitShader( const char* vertexShaderFile, const char* fragmentShaderFile );

If someone is interested to see the cpp, glsl and h files. They are all here http://www.cs.unm.edu/~angel/BOOK/INTERACTIVE_COMPUTER_GRAPHICS/SIXTH_EDITION/CODE/CHAPTER02/MAC_VERSIONS/

Hlöðver
  • 101
  • 1
  • 7

1 Answers1

0

You need to add InitShader.cpp (where the function InitShader is defined) to your project as well as the header file.

  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Diemuzi Feb 02 '15 at 21:29
  • The link doesn't contain essential parts of the answer; it's the file he needs to include. I edited my answer to add some context. – user2993392 Feb 03 '15 at 01:08