Something about include file
yesterday I download and install QT-5.3 on my linux(ubuntukylin),today I try to compile my first QT-project.
I write the code by VIM like like this :
int main(int argc, char *argv)
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
I save this file when I finished , and the file's path is /home/jxf/TestQt
so far,everything is going well
when I used last commond : make
the system tell me,"fatal error: QApplication: No such file or directory",
then I try to find answer in inter,and someone tell me put "QT += widgets" in TestQt.pro.
I do like this and compile again,but system tell me "fatal error: Qlabel: No such file or directory" this time,
others in inernet tell me modify source code file,
#include<QtWidgets/QLabel> replace #include<QLabel>,
but when I make ,system still tell me fatal error: Qlabel: No such file or directory
How can I do....
[quote author="andreyc" date="1402808566"]Could you show TestQt.pro ?
Did you run qmake to regenerate Makefile after you have changed TestQt.pro?[/quote]
Could you show TestQt.pro ?
ls -l /home/jxf/testQt
TEMPLATE = app
TARGET = testQt
QT += widgets
Did you run qmake to regenerate Makefile after you have changed TestQt.pro?
if I hadn't input "QT += widgets",system will tell me " fatal error: QApplication: No such file or directory" when I using commond "make".
if I had input like source file,system will tell me "fatal error: Qlabel: No such file or directory".
I copied your files and it run without any errors.
Is it possible that you have another version of Qt installed?
Qt-4 that comes with Ubuntu for example.
Try to run qmake from Qt-5.3 using full path.
Something like this