I'm running Qt5.0.0 msvc2010 and I'm trying to add 3 files to a very basic project using the "add existing files" option of Qt Creator. The only intent of this project is to display a window created with Qt Designer.
The 3 files are mainwindow.h, mainwindow.cpp and mainwindow.ui automatically generated by Qt Designer.
When I try to compile, I get this: fatal error C1083: Cannot open include file: 'mainwindow.h': No such file or directory.
The files are correctly located in my projet file and qmake runs fine.
QT += widgets
SOURCES += \
main.cpp \
../test/mainwindow_test_form/mainwindow.cpp[ATTACH=CONFIG]8718[/ATTACH]
FORMS += \
../test/mainwindow_test_form/mainwindow.ui
HEADERS += \
../test/mainwindow_test_form/mainwindow.h
QT += widgets
SOURCES += \
main.cpp \
../test/mainwindow_test_form/mainwindow.cpp[ATTACH=CONFIG]8718[/ATTACH]
FORMS += \
../test/mainwindow_test_form/mainwindow.ui
HEADERS += \
../test/mainwindow_test_form/mainwindow.h
To copy to clipboard, switch view to plain text mode
My main.cpp files look like this:
#include <QApplication>
#include <QtGui>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
MainWindow theMainWindow;
theMainWindow.show();
return app.exec();
}
#include <QApplication>
#include <QtGui>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow theMainWindow;
theMainWindow.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
I tried to put the 3 files in different locations (in or out of the project) and I still get the same result.
Any Suggestions?
Thanks!
I have attached a screenshot of my project in Qt Creator too. It might help.
Bookmarks