Results 1 to 4 of 4

Thread: fatal error C1083: Cannot open include file: 'QApplication': No such file or director

  1. #1
    Join Date
    Nov 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default fatal error C1083: Cannot open include file: 'QApplication': No such file or director

    Hi,

    I have just started both with QT and Visual Studio . I wanted to build the following code:

    #include <QApplication>
    #include <QLabel>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    QLabel *label = new QLabel("Hello Qt!");
    label->show();
    return app.exec();
    }


    and I one got fatal error as:
    fatal error C1083: Cannot open include file: 'QApplication': No such file or directory


    what do you suggest me to do?

    Thanks a lot in advance,
    Violet

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: fatal error C1083: Cannot open include file: 'QApplication': No such file or dire

    Add the folder of the Qt include files to the paths that are used for finding headers.

  3. #3
    Join Date
    Nov 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: fatal error C1083: Cannot open include file: 'QApplication': No such file or dire

    Thanks a lot for your early response,

    I am not sure if I got correctly but I copied the Qt include files to the path of the project but still have the error.
    I looked for QApplication but couldn't find it, so maybe I have to add some libraries for QApplication?

    Regards,
    Violet

  4. #4
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: fatal error C1083: Cannot open include file: 'QApplication': No such file or dire

    Don't just copy headers, you will need to download the already built for Visual Studio Qt version (the one named Qt libraries 4.7.0 for Windows (VS 2008, 226 MB)), from here and the Visual Studio add-in(add-in doesn't work with express version of Visual Studio)
    Or build Qt from source yourself.

    But you can download the Qt SDK and use it, you have advantages with Visual Studio only if you already know the IDE. I think that you can separate the Visual Studio learning from Qt learning, and in the future "combine" them only if you really need them together.

Similar Threads

  1. Replies: 0
    Last Post: 3rd June 2010, 05:54
  2. Replies: 4
    Last Post: 9th May 2010, 17:18
  3. Replies: 7
    Last Post: 18th September 2009, 15:44
  4. Replies: 1
    Last Post: 27th March 2009, 07:22
  5. Replies: 4
    Last Post: 24th November 2007, 14:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.