fatal error C1083: Cannot open include file: 'QApplication': No such file or director
Hi,
I have just started both with QT and Visual Studio :o. 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
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.
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
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.