Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Opengl - Shader problem

  1. #1
    Intern Contributor
    Join Date
    Mar 2012
    Posts
    50

    Opengl - Shader problem

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

    when i got these errors:
    Code :
    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.

    My linkers are this:
    Code :
    SOIL.lib
    opengl32.lib
    glu32.lib
    glut32.lib

    How can i solve these errors?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Singapore
    Posts
    802

    Re: Opengl - Shader problem

    This seems to be a problem with the C++ code. Have you implemented the constructor/destructor pair in the cwc::glShaderManager class?
    Regards,
    Mobeen

  3. #3
    Intern Contributor
    Join Date
    Mar 2012
    Posts
    50

    Re: Opengl - Shader problem

    I didn't personally make the class i just took it from opengl.org.
    The glShaderManager in the glsl file. Here are some excerpts from the header and source relating to the glShaderManager class

    glsl.h
    Code :
    namespace cwc
    {
       class glShaderManager;
       class GLSLAPI glShader
       {
          friend class glShaderManager;
       }
       class GLSLAPI glShaderManager
       {
       public:
           glShaderManager();
           virtual ~glShaderManager();
       }

    glsl.cpp
    Code :
    // ShaderManager: Easy use of (multiple) Shaders
     
    glShaderManager::glShaderManager()
    {
       InitOpenGLExtensions();
       _nInputPrimitiveType = GL_TRIANGLES;
       _nOutputPrimitiveType = GL_TRIANGLE_STRIP;
       _nVerticesOut = 3;
     
    }
     
    glShaderManager::~glShaderManager()
    {
       // free objects
       vector<glShader*>::iterator  i=_shaderObjectList.begin();
       while (i!=_shaderObjectList.end()) 
       {
            //glShader* o = *i;
            i=_shaderObjectList.erase(i);
            //delete o;
       }
    }

  4. #4
    Intern Contributor
    Join Date
    Mar 2012
    Posts
    50

    Re: Opengl - Shader problem

    bump

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •