Bug #717

GLDraw - GLEW linking problem on Windows (Speed, Optimal compilation mode)

Added by Zbigniew Rebacz over 10 years ago. Updated over 10 years ago.

Status:ApprovedStart date:03/12/2014
Priority:NormalDue date:
Assignee:Zbigniew Rebacz% Done:

0%

Category:GLDrawSpent time:-
Target version:-

Description

I have got following errors while compiling GLDraw in speed mode. Debug mode works fine.

GLDraw.lib(GLDrawS.obj) : error LNK2019: unresolved external symbol __imp____glewGetUniformLocation referenced in function "public: int __thiscall Upp::GLProgram::GetUniform(char const *)" (?GetUniform@GLProgram@Upp@@QA
    EHPBD@Z)
GLDraw.lib(GLDrawS.obj) : error LNK2019: unresolved external symbol __imp____glewUseProgram referenced in function "public: void __thiscall Upp::GLProgram::Use(void)" (?Use@GLProgram@Upp@@QAEXXZ)
GLDraw.lib(GLShaders.obj) : error LNK2001: unresolved external symbol __imp____glewUseProgram
GLDraw.lib(GLDrawS.obj) : error LNK2019: unresolved external symbol __imp____glewEnableVertexAttribArray referenced in function "void __cdecl Upp::initializeGL(void)" (?initializeGL@Upp@@YAXXZ)
GLDraw.lib(GLDrawS.obj) : error LNK2019: unresolved external symbol __imp____glewUniform1i referenced in function "void __cdecl Upp::initializeGL(void)" (?initializeGL@Upp@@YAXXZ)
GLDraw.lib(GLDrawS.obj) : error LNK2019: unresolved external symbol __imp__glewInit referenced in function "void __cdecl Upp::initializeGL(void)" (?initializeGL@Upp@@YAXXZ)
GLDraw.lib(GLDrawS.obj) : error LNK2019: unresolved external symbol __imp____glewUniformMatrix4fv referenced in function "void __cdecl Upp::GLOrtho(float,float,float,float,float,float,unsigned int)" (?GLOrtho@Upp@@YAXMM
    MMMMI@Z)
GLDraw.lib(GLDrawS.obj) : error LNK2019: unresolved external symbol __imp____glewDisableVertexAttribArray referenced in function "private: void __thiscall Upp::GLDraw::FlushPutRect(void)" (?FlushPutRect@GLDraw@Upp@@AAEX
    XZ)
GLDraw.lib(GLDrawS.obj) : error LNK2019: unresolved external symbol __imp____glewVertexAttribPointer referenced in function "private: void __thiscall Upp::GLDraw::FlushPutRect(void)" (?FlushPutRect@GLDraw@Upp@@AAEXXZ)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewDeleteShader referenced in function "public: void __thiscall Upp::GLProgram::Clear(void)" (?Clear@GLProgram@Upp@@QAEXXZ)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewDeleteProgram referenced in function "public: void __thiscall Upp::GLProgram::Clear(void)" (?Clear@GLProgram@Upp@@QAEXXZ)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewGetShaderInfoLog referenced in function "unsigned int __cdecl Upp::LoadShader(char const *,unsigned int)" (?LoadShader@Upp@@YAIPBDI@Z)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewGetShaderiv referenced in function "unsigned int __cdecl Upp::LoadShader(char const *,unsigned int)" (?LoadShader@Upp@@YAIPBDI@Z)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewCompileShader referenced in function "unsigned int __cdecl Upp::LoadShader(char const *,unsigned int)" (?LoadShader@Upp@@YAIPBDI@Z)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewShaderSource referenced in function "unsigned int __cdecl Upp::LoadShader(char const *,unsigned int)" (?LoadShader@Upp@@YAIPBDI@Z)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewCreateShader referenced in function "unsigned int __cdecl Upp::LoadShader(char const *,unsigned int)" (?LoadShader@Upp@@YAIPBDI@Z)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewGetProgramInfoLog referenced in function "public: void __thiscall Upp::GLProgram::Create(char const *,char const *,struct Upp::Tuple2<in
    t,char const *> *,int)" (?Create@GLProgram@Upp@@QAEXPBD0PAU?$Tuple2@HPBD@2@H@Z)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewGetProgramiv referenced in function "public: void __thiscall Upp::GLProgram::Create(char const *,char const *,struct Upp::Tuple2<int,cha
    r const *> *,int)" (?Create@GLProgram@Upp@@QAEXPBD0PAU?$Tuple2@HPBD@2@H@Z)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewLinkProgram referenced in function "public: void __thiscall Upp::GLProgram::Create(char const *,char const *,struct Upp::Tuple2<int,char
     const *> *,int)" (?Create@GLProgram@Upp@@QAEXPBD0PAU?$Tuple2@HPBD@2@H@Z)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewBindAttribLocation referenced in function "public: void __thiscall Upp::GLProgram::Create(char const *,char const *,struct Upp::Tuple2<i
    nt,char const *> *,int)" (?Create@GLProgram@Upp@@QAEXPBD0PAU?$Tuple2@HPBD@2@H@Z)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewAttachShader referenced in function "public: void __thiscall Upp::GLProgram::Create(char const *,char const *,struct Upp::Tuple2<int,cha
    r const *> *,int)" (?Create@GLProgram@Upp@@QAEXPBD0PAU?$Tuple2@HPBD@2@H@Z)
GLDraw.lib(GLShaders.obj) : error LNK2019: unresolved external symbol __imp____glewCreateProgram referenced in function "public: void __thiscall Upp::GLProgram::Create(char const *,char const *,struct Upp::Tuple2<int,ch
    ar const *> *,int)" (?Create@GLProgram@Upp@@QAEXPBD0PAU?$Tuple2@HPBD@2@H@Z)
E:\Programy\upp\upp\out\reference\MSC10.Force_Speed.Gui.Sse2\GLDrawDemo.exe : fatal error LNK1120: 21 unresolved externals

History

#1 Updated by Zbigniew Rebacz over 10 years ago

The problem is with static linking. It seems that glew by default is using dynamic linking. Possible solution:

Define where you want for example at the beggining of glew.h(GLDraw package) file:

#define GLEW_STATIC

#2 Updated by Zbigniew Rebacz over 10 years ago

  • Category changed from GLCtrl to GLDraw

#3 Updated by Zbigniew Rebacz over 10 years ago

  • Status changed from New to Approved
  • Assignee set to Zbigniew Rebacz

Also available in: Atom PDF