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. QT5 Linker error for VS2012 [SOLVED]
Forum Updated to NodeBB v4.3 + New Features

QT5 Linker error for VS2012 [SOLVED]

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 5.3k 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.
  • R Offline
    R Offline
    Raveendra
    wrote on 20 Jun 2013, 18:50 last edited by
    #1

    I'm using Visaul studio 2012 with QT5 SDK and qt-VS add-on 1.2.1 and trying to build the qt Application. I've included dependent libs to compile but i'm getting linker error like this

    main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QApplication::QApplication(int &,char * *,int)" (_imp??0QApplication@@QAE@AAHPAPADH@Z)
    1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QApplication::~QApplication(void)" (_imp??1QApplication@@UAE@XZ)
    1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static int __cdecl QApplication::exec(void)" (_imp?exec@QApplication@@SAHXZ)
    1>mainwindow.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QWidget::QWidget(class QWidget *,class QFlags<enum Qt::WindowType>)" (_imp??0QWidget@@QAE@PAV0@V?$QFlags@W4WindowType@Qt@@@@@Z)
    1>mainwindow.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QWidget::~QWidget(void)" (_imp??1QWidget@@UAE@XZ)
    1>mainwindow.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWidget::setWindowTitle(class QString const &)" (_imp?setWindowTitle@QWidget@@QAEXABVQString@@@Z)
    1>mainwindow.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWidget::resize(class QSize const &)" (_imp?resize@QWidget@@QAEXABVQSize@@@Z)
    1>mainwindow.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QMainWindow::QMainWindow(class QWidget *,class QFlags<enum Qt::WindowType>)" (_imp??0QMainWindow@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z)
    1>mainwindow.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QMainWindow::~QMainWindow(void)" (_imp??1QMainWindow@@UAE@XZ)
    1>mainwindow.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall QMainWindow::setMenuBar(class QMenuBar *)" (_imp?setMenuBar@QMainWindow@@QAEXPAVQMenuBar@@@Z)
    1>mainwindow.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall QMainWindow::setStatusBar(class QStatusBar *)" (_imp?setStatusBar@QMainWindow@@QAEXPAVQStatusBar@@@Z)

    What dependant libraries i'm missing here. please help me

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 20 Jun 2013, 20:19 last edited by
      #2

      Hi,

      Does your pro file include a line like
      @
      QT += widgets
      @

      ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Raveendra
        wrote on 21 Jun 2013, 05:57 last edited by
        #3

        yeah. I was missing that. thanks that solved my problem

        1 Reply Last reply
        0

        3/3

        21 Jun 2013, 05:57

        • Login

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