Win7 : Error c1083: Cannot open include file: QApplication: no such file or directory



  • Hi , i have this problem on Windows:

    Installed MSVs 2010 ultimate
    Qt 5

    When creating an Empty Qt Project, add new c++ source and just put #include <QApplication>
    i get the error.

    Qt Projects show:

    INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\INCLUDE;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include;C:\Qt\Qt5.0.0\5.0.0\msvc2010\include
    LIB=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib;C:\Qt\Qt5.0.0\5.0.0\msvc2010\lib

    INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\INCLUDE;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include;C:\Qt\Qt5.0.0\5.0.0\msvc2010\include
    LIB=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib;C:\Qt\Qt5.0.0\5.0.0\msvc2010\lib

    any idea what is going wrong ?


  • Moderators

    In your .pro file:
    @
    QT += core gui widgets
    @

    And it should work. If not, then add this include:
    @
    #include <QtWidgets/QApplication>
    @



  • Hi THX for the reply, but it didn't helped.

    I'm new with Qt and folled Youtube http://www.youtube.com/watch?v=Gk3zh5lA4ww

    Got it worked this way:

    Instaed of create an Empty Qt Project; create a Qt Gui App
    and delete the Form etc....now it works.

    THX



  • With an empty Qt Project, you could have right clicked on the solution and edited the qt project settings by adding the Qt Gui library that way.



  • Also, you can simply right click on the project/solution name (in the TreeView) and click in "Run qmake", after doing it, rebuild or run the project.


Log in to reply
 

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