Qt + opengl



  • I have a c++ code using Qt+Opengl SDK.
    My code runs fine in debug mode.
    but when compiling the code in release mode it throws a link error (LNK2019).
    any solutions for this?



  • Post the linker error if possible both from "Compile Output" and "Issues".



  • compiler output:
    glwidget.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "public: virtual void __thiscall GLWidget::paintGL(void)" (?paintGL@GLWidget@@UAEXXZ)
    1>D:\Projects\2\Win32\Release\Haft_Hoz.exe : fatal error LNK1120: 26 unresolved externals

    error:
    Error 42 error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function "protected: void __thiscall GLWidget::DrawFlower(int,int,float,float,float,float,float,float,float,float)" (?DrawFlower@GLWidget@@IAEXHHMMMMMMMM@Z) D:\Projects\2\Haft_Hoz\glwidget.obj

    i have 27 link errors for each opengl function that i have used in my code.



  • glwidget.obj : error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function "protected: void __thiscall GLWidget::Pick_Texture(int)" (?Pick_Texture@GLWidget@@IAEXH@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glFrustum@48 referenced in function "public: void __thiscall GLWidget::perspective(double,double,double,double)" (?perspective@GLWidget@@QAEXNNNN@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glDisable@4 referenced in function "protected: void __thiscall GLWidget::loadTexture(char *,unsigned int &)" (?loadTexture@GLWidget@@IAEXPADAAI@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glTexParameteri@12 referenced in function "protected: void __thiscall GLWidget::loadTexture(char *,unsigned int &)" (?loadTexture@GLWidget@@IAEXPADAAI@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glTexImage2D@36 referenced in function "protected: void __thiscall GLWidget::loadTexture(char *,unsigned int &)" (?loadTexture@GLWidget@@IAEXPADAAI@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glGenTextures@8 referenced in function "protected: void __thiscall GLWidget::loadTexture(char *,unsigned int &)" (?loadTexture@GLWidget@@IAEXPADAAI@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glBlendFunc@8 referenced in function "protected: void __thiscall GLWidget::loadTexture(char *,unsigned int &)" (?loadTexture@GLWidget@@IAEXPADAAI@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "protected: void __thiscall GLWidget::loadTexture(char *,unsigned int &)" (?loadTexture@GLWidget@@IAEXPADAAI@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glPopMatrix@0 referenced in function "protected: void __thiscall GLWidget::DrawFlower(int,int,float,float,float,float,float,float,float,float)" (?DrawFlower@GLWidget@@IAEXHHMMMMMMMM@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function "protected: void __thiscall GLWidget::DrawFlower(int,int,float,float,float,float,float,float,float,float)" (?DrawFlower@GLWidget@@IAEXHHMMMMMMMM@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glVertex3f@12 referenced in function "protected: void __thiscall GLWidget::DrawFlower(int,int,float,float,float,float,float,float,float,float)" (?DrawFlower@GLWidget@@IAEXHHMMMMMMMM@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glTexCoord3f@12 referenced in function "protected: void __thiscall GLWidget::DrawFlower(int,int,float,float,float,float,float,float,float,float)" (?DrawFlower@GLWidget@@IAEXHHMMMMMMMM@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function "protected: void __thiscall GLWidget::DrawFlower(int,int,float,float,float,float,float,float,float,float)" (?DrawFlower@GLWidget@@IAEXHHMMMMMMMM@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glColor4f@16 referenced in function "protected: void __thiscall GLWidget::DrawFlower(int,int,float,float,float,float,float,float,float,float)" (?DrawFlower@GLWidget@@IAEXHHMMMMMMMM@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glRotatef@16 referenced in function "protected: void __thiscall GLWidget::DrawFlower(int,int,float,float,float,float,float,float,float,float)" (?DrawFlower@GLWidget@@IAEXHHMMMMMMMM@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glScalef@12 referenced in function "protected: void __thiscall GLWidget::DrawFlower(int,int,float,float,float,float,float,float,float,float)" (?DrawFlower@GLWidget@@IAEXHHMMMMMMMM@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glTranslatef@12 referenced in function "protected: void __thiscall GLWidget::DrawFlower(int,int,float,float,float,float,float,float,float,float)" (?DrawFlower@GLWidget@@IAEXHHMMMMMMMM@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glPushMatrix@0 referenced in function "protected: void __thiscall GLWidget::DrawFlower(int,int,float,float,float,float,float,float,float,float)" (?DrawFlower@GLWidget@@IAEXHHMMMMMMMM@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glOrtho@48 referenced in function "public: virtual void __thiscall GLWidget::resizeGL(int,int)" (?resizeGL@GLWidget@@UAEXHH@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "public: virtual void __thiscall GLWidget::resizeGL(int,int)" (?resizeGL@GLWidget@@UAEXHH@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "public: virtual void __thiscall GLWidget::resizeGL(int,int)" (?resizeGL@GLWidget@@UAEXHH@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "public: virtual void __thiscall GLWidget::resizeGL(int,int)" (?resizeGL@GLWidget@@UAEXHH@Z)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "public: virtual void __thiscall GLWidget::initializeGL(void)" (?initializeGL@GLWidget@@UAEXXZ)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glLightfv@12 referenced in function "public: virtual void __thiscall GLWidget::paintGL(void)" (?paintGL@GLWidget@@UAEXXZ)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glLightModelfv@8 referenced in function "public: virtual void __thiscall GLWidget::paintGL(void)" (?paintGL@GLWidget@@UAEXXZ)
    1>glwidget.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "public: virtual void __thiscall GLWidget::paintGL(void)" (?paintGL@GLWidget@@UAEXXZ)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.