I'm under Visual Studio 2010 and have installed qt-vs-addin-1.1.11-opensource.exe and qt-win-opensource-4.8.4-vs2010.exe. There is Qt in my VS menu. When I tried to start Qt4 project->Qt Application and error seemed to occur.
Here is the default code generated automatically:
#include "sp_qt.h"
#include <QtGui/QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
SP_Qt w;
w.show();
return a.exec();
}
Error: Cannot open include file QtGui/QApplication
It seems VS cannot find the header.I know this should be simple, I have tried to modify environment variables PATH and QTDIR but doesn't seem to work(I added C:\Qt\4.8.4\bin to PATH and C:\Qt to QTDIR).
You need to make sure the path to the QT header files are in the project settings. Open up the project settings and go into "Configuration Properties-> C/C++ -> General" and add the path in "Additional Include Directories.
You can access the project properties by either right clicking on the project and selecting "Properties" or selecting the "Project" menu and selecting "Properties".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With