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 3 of 3

Thread: GLSL error ..???

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    7

    GLSL error ..???

    hi all
    i get this error
    Code :
    --------------------Configuration: main - Win32 Debug--------------------
    Linking...
    main.obj : error LNK2001: unresolved external symbol "public: __thiscall aShaderManager::aShaderManager(void)" (??0aShaderManager@@QAE@XZ)
    main.obj : error LNK2001: unresolved external symbol "public: __thiscall aShaderManager::~aShaderManager(void)" (??1aShaderManager@@QAE@XZ)
    main.obj : error LNK2001: unresolved external symbol "public: class aShaderObject * __thiscall aShaderManager::loadfromMemory(char const *,char const *)" (?loadfromMemory@aShaderManager@@QAEPAVaShaderObject@@PBD0@Z)
    main.obj : error LNK2001: unresolved external symbol "public: void __thiscall aShaderObject::end(void)" (?end@aShaderObject@@QAEXXZ)
    main.obj : error LNK2001: unresolved external symbol "public: void __thiscall aShaderObject::begin(void)" (?begin@aShaderObject@@QAEXXZ)
    LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/main.exe : fatal error LNK1120: 6 unresolved externals
    Error executing link.exe.
     
    main.exe - 7 error(s), 0 warning(s)
    when i try to compile this code

    Code :
    // ****************************************************
    // Simple program to test GLSL Shaders
    //
    // This Program shows how to load a Shader from memory
    //
    // Implement the functions:
    //        AppInit() to initialize                  
    //        AppExit() to clean up
    // and    DrawFrame() to draw one frame
    // ****************************************************
    #include <windows.h>
    #include "../cwc/aGLSL.h"
    #include <GL/glut.h>
    #include <GL/gl.h>
     
    aShaderManager  shadermanager;
    aShaderObject*  shader;
     
    static const char* myVertexShader =                      
    "void main(void)                                     \n"
    "{                                                   \n"
    "	vec4 a = vec4(1.0,0.5,1.0,1.0) * gl_Vertex;      \n"
    "	gl_Position = gl_ModelViewProjectionMatrix * a;  \n"
    "}                                                   \n\0";
     
    static const char* myFragmentShader =                      
    "void main (void)                                    \n"
    "{                                                   \n"
    "	gl_FragColor = vec4 (0.0, 1.0, 0.0, 1.0);        \n"
    "}                                                   \n\0";
     
    //*************************************************************
    // at the time of App init, glut is already initialized
    // and standard OpenGL settings are done. You could test
    // extensions etc now!
     
    void AppInit(void)
    { 
      shader = shadermanager.loadfromMemory(myVertexShader,myFragmentShader);
     
      if (shader==0)
      {
          std::cout << "error: can't init shader!\n";
          exit(-1);
      }
     
      //shader = shadermanager.loadfromFile("test.vert","test.frag"); 
    }
     
    //*************************************************************
    //Draw one Frame (don't Swap Buffers)
    void DrawFrame(void)
    {
        shader->begin();
        glutSolidTeapot(1.5);
        shader->end();
    }
     
     
    //*************************************************************
    // use App Exit to clean up
    void AppExit(void)
    {
     
    }
     
    //*************************************************************
    thank you all for any reply
    bye!

  2. #2
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    1

    Re: GLSL error ..???

    Hi squall!!

    May I ask you somthing..??

    Are you write code about construct functions

    body??

    and the others...(Error list)
    ^_ ____________________ _ ^?

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    857

    Re: GLSL error ..???

    Those aren't GLSL errors, they're C++ compiler errors, and this is not the forum to discuss them in.

    -- Tom

Posting Permissions

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