Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Qt 5.6.0 configure with Visual Studio 2015
QtWS25 Last Chance

Qt 5.6.0 configure with Visual Studio 2015

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
3 Posts 3 Posters 1.6k Views
  • 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.
  • E Offline
    E Offline
    eaksshe
    wrote on last edited by
    #1

    I am trying to configure Qt5.6.0 third party library in my visual studio.

    I have set the all the environmental directories in visual studio. like below one.

    Include directories - D:\5.6.0\WIN8664\include\QtCore D:\5.6.0\WIN8664\include\QtWidgets D:\5.6.0\WIN8664\include

    Additional include directories - D:\5.6.0\WIN8664\include;

    Linker - Additional library directories - D:\5.6.0\WIN8664\lib ;D:\5.6.0\WIN8664\plugins\platforms

    Linker - Additional dependencies - Qt5Gui.lib;Qt5Core.lib

    My code is snippet is like below one - C++ Empty project- source.cpp

    #include <QApplication>
    #include <QPushButton>

    int main(int argc, char **argv)
    {
    QApplication a(argc, argv);

    //QPushButton hello("Hello world!", 0);
    //hello.resize(100, 30);
    //
    //a.setActiveWindow(&hello);
    //
    //

    ////a.setMainWidget(&hello);
    //hello.show();
    return a.exec();
    }

    While building above code in VS2015, it throws following errors-

    1>------ Rebuild All started: Project: Test, Configuration: Debug x64 ------ 1> Source.cpp 1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QApplication::QApplication(int &,char * *,int)" (_imp??0QApplication@@QEAA@AEAHPEAPEADH@Z) referenced in function main 1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl QApplication::~QApplication(void)" (_imp??1QApplication@@UEAA@XZ) referenced in function main 1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int __cdecl QApplication::exec(void)" (_imp?exec@QApplication@@SAHXZ) referenced in function main 1>E:\QT\Test\x64\Debug\Test.exe : fatal error LNK1120: 3 unresolved externals ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      QApplication and QPushButton are part of the widgets module so you also need to link to Qt5Widgets.lib.

      1 Reply Last reply
      2
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by
        #3

        On a separate note you can use the Qt Visual Studio Tools extension to facilitate the process

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        2

        • Login

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