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

Thread: GLSL Setup

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

    GLSL Setup

    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

    Code :
     
    >------ 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 ==========

  2. #2
    Intern Contributor
    Join Date
    Mar 2012
    Posts
    50
    I was told to add the shader.cpp & shader.h to my project instead of just having it in the folder, and now i get these new errors:

    Code :
    [FONT=Consolas][SIZE=1][FONT=Consolas][SIZE=1]1>------ Build started: Project: TheLightingExperiment2, Configuration: Debug Win32 ------
     
    1>shader.obj : error LNK2001: unresolved external symbol __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
     
    1>shader.obj : error LNK2001: unresolved external symbol __imp____glewShaderSource
     
    1>shader.obj : error LNK2001: unresolved external symbol __imp____glewCreateShader
     
    1>shader.obj : error LNK2001: unresolved external symbol __imp____glewDeleteProgram
     
    1>shader.obj : error LNK2001: unresolved external symbol __imp____glewDeleteShader
     
    1>shader.obj : error LNK2001: unresolved external symbol __imp____glewDetachShader
     
    1>shader.obj : error LNK2001: unresolved external symbol __imp____glewUseProgram
     
    1>C:\Users\Shawn\Desktop\TheLightingExperiment2\Debug\TheLightingExperiment2.exe : fatal error LNK1120: 10 unresolved externals
     
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    [/SIZE][/FONT][/SIZE][/FONT]

    Did i solve the previous problem, or am i digging myself deeper?

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2006
    Location
    Downey, CA
    Posts
    20
    Looks like you forgot to put glew32 in your linker.

    If you're using visual studio, you need to add it under additional dependencies.
    Visit Lazy Foo' Productions home of my SDL tutorials

    Want to transition from OpenGL 2.1 to 3.0+? Check out my OpenGL Tutorial

  4. #4
    Intern Contributor
    Join Date
    Mar 2012
    Posts
    50
    Thank you!

  5. #5
    Newbie Newbie
    Join Date
    Nov 2012
    Posts
    1
    Quote Originally Posted by shawn619 View Post
    Thank you!
    I got same errors!
    How did you do to fix it?

Posting Permissions

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