# OpenGL Opengl - shader problem

This topic is 2404 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm trying to mimic the shader used in opengl.org website http://www.opengl.or...rs/lighting.php , but i only got so far as declaring the following object:
 cwc::glShaderManager SM; 

when i got these errors:
 error LNK2001: unresolved external symbol "public: __thiscall cwc::glShaderManager::glShaderManager(void)" 0glShaderManager@cwc@@QAE@XZ"]??0glShaderManager@cwc@@QAE@XZ) error LNK2001: unresolved external symbol "public: virtual __thiscall cwc::glShaderManager::~glShaderManager(void)" 1glShaderManager@cwc@@UAE@XZ"]1glShaderManager@cwc@@UAE@XZ) 

I included all the necessary includes exactly the same as the project on the website has it. I don't know why im getting linker errors when i never added any shader linkers, and this is because the project on the website didnt have any shader linkers.

 SOIL.lib opengl32.lib glu32.lib glut32.lib 

How can i solve these errors?

##### Share on other sites
I checked the following link. I found them on "archive:cwc\source\glsl.cpp"
Are you sure that you included this file to your project?

Best wishes, FXACE.

##### Share on other sites
I belive i did it correctly because i mimic'd the example by doing the following:

- glew/include
- cwc/include
- freeglut/include

And with my project folder looking like this:

##### Share on other sites
But did you add the file FXACE mentioned in your project? You have probably included the files because your code compiles just fine so the include paths and such are just fine, but the linker cannot assemble the final program because it cannot find the actual code for the functions anywhere.

##### Share on other sites
Sorry, i should'uv mentioned in my previous post that glsl.cpp is located in the cwc folder(cwc/source) you see in the picture, and since that folder is an include i cant see why its giving me errors.

*Note: The cwc folder is broken down into two seperate folders "include" and "source", the include folder has header(.h) and source folder has the implementation(.cpp)

##### Share on other sites
But is the file added to your project? It's not enough that the file itself is located in the folder, it has to be in the project as well or the compiler won't compile it.

##### Share on other sites
This is what my project currently looks like:

And if i add the existing "glsl.cpp" file from the cwc folder of my project and add it into my project, like you mentioned, then my compiler brings up 78 unresolved linker errors

##### Share on other sites
That means you have other files missing in the project as well. If you want to use the code in glsl.cpp, then you have to add it to the project, and you also have to add whatever code it requires.

##### Share on other sites
But i can use glut and opengl function fine without adding them to my project. It's just adding glsl is giving me all trouble =S and like what i said above when i add it i get 78 glew errors. And when i add the 3 folders to my project, tons of errors complaining of duplicates

##### Share on other sites
OpenGL and GLUT are automatically linked when you include the GLUT header. If you open the GLUT header file, you will see some code in there that automatically adds the correct library files to the linker (some #pragma-directives in the beginning of the header file if I remember correct).

If you're getting linker errors related to GLEW, then you simply need to add those files to the project as well.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632998
• Total Posts
3009808
• ### Who's Online (See full list)

There are no registered users currently online

×