Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to solve error LNK2001: unresolved external symbol?
Forum Updated to NodeBB v4.3 + New Features

How to solve error LNK2001: unresolved external symbol?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 5.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mathi77in
    wrote on last edited by
    #1

    Hi,
    i am beginner of QT. i am using Qt 4.5 library. I try the sample program for OpenGL Examples.

    "i try the following example code like...":http://doc.qt.nokia.com/4.5/opengl-hellogl.html

    Once i build this example in my qt, i got some link errors...

    like

    @lines.obj : error LNK2005: "public: __thiscall GLWidget::GLWidget(class QWidget *)" (??0GLWidget@@QAE@PAVQWidget@@@Z) already defined in GLWidget.obj
    1>lines.obj : error LNK2005: "protected: virtual void __thiscall GLWidget::initializeGL(void)" (?initializeGL@GLWidget@@MAEXXZ) already defined in GLWidget.obj
    1>GLWidget.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QGLWidget::~QGLWidget(void)" (_imp??1QGLWidget@@UAE@XZ) referenced in function __unwindfunclet$??0GLWidget@@QAE@PAVQWidget@@@Z$0
    1>lines.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QGLWidget::~QGLWidget(void)" (_imp??1QGLWidget@@UAE@XZ)
    1>Main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QGLWidget::~QGLWidget(void)" (_imp??1QGLWidget@@UAE@XZ)
    1>GLWidget.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QGLWidget::setMouseTracking(bool)" (_imp?setMouseTracking@QGLWidget@@QAEX_N@Z) referenced in function "public: __thiscall GLWidget::GLWidget(class QWidget *)" (??0GLWidget@@QAE@PAVQWidget@@@Z)
    1>GLWidget.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QGLWidget::QGLWidget(class QWidget *,class QGLWidget const *,class QFlags<enum Qt::WindowType>)" (_imp??0QGLWidget@@QAE@PAVQWidget@@PBV0@V?$QFlags@W4WindowType@Qt@@@@@Z) referenced in function "public: __thiscall GLWidget::GLWidget(class QWidget *)" (??0GLWidget@@QAE@PAVQWidget@@@Z)
    1>lines.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QGLWidget::QGLWidget(class QWidget *,class QGLWidget const *,class QFlags<enum Qt::WindowType>)" (_imp??0QGLWidget@@QAE@PAVQWidget@@PBV0@V?$QFlags@W4WindowType@Qt@@@@@Z)
    1>GLWidget.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall QGLWidget::event(class QEvent *)" (?event@QGLWidget@@MAE_NPAVQEvent@@@Z)
    1>lines.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall QGLWidget::event(class QEvent *)" (?event@QGLWidget@@MAE_NPAVQEvent@@@Z)
    1>GLWidget.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "protected: virtual void __thiscall GLWidget::initializeGL(void)" (?initializeGL@GLWidget@@MAEXXZ)
    @

    How to solve this error?

    Thanks
    M.Mathi

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tucnak
      wrote on last edited by
      #2

      Try to clean project and review your meta-information.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved