reeseslover531
January 14th, 2008, 03:33 AM
ok so I am using the latest KDevelop. I create a Basic QT4 application from under the QTMake project folder. MY code is
#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 run build project and it asks me to run qmake first, which I do, but then it spits out all these errors
cd '/home/joe/ta' && make -k
cd src/ && make -f Makefile
compiling main.cpp (g++)
main.cpp:22:24: error: QApplication: No such file or directory
main.cpp:23:18: error: QLabel: No such file or directory
main.cpp: In function ‘int main(int, char**)’:
main.cpp:26: error: ‘QApplication’ was not declared in this scope
main.cpp:26: error: expected `;' before ‘app’
main.cpp:27: error: ‘QLabel’ was not declared in this scope
main.cpp:27: error: ‘label’ was not declared in this scope
main.cpp:27: error: expected type-specifier before ‘QLabel’
main.cpp:27: error: expected `;' before ‘QLabel’
main.cpp:29: error: ‘app’ was not declared in this scope
main.cpp: At global scope:
main.cpp:24: warning: unused parameter ‘argc’
main.cpp:24: warning: unused parameter ‘argv’
make[1]: *** [main.o] Error 1
make[1]: Target `first' not remade because of errors.
make: *** [sub-src-make_default] Error 2
make: Target `first' not remade because of errors.
*** Exited with status: 2 ***
My problem is if I go into the folder of my project and run qmake-qt4 -project and then qmake-qt4 test.pro (which is the name of my project) and then run make, it complies and then runs fine. What am I doing wrong??
#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 run build project and it asks me to run qmake first, which I do, but then it spits out all these errors
cd '/home/joe/ta' && make -k
cd src/ && make -f Makefile
compiling main.cpp (g++)
main.cpp:22:24: error: QApplication: No such file or directory
main.cpp:23:18: error: QLabel: No such file or directory
main.cpp: In function ‘int main(int, char**)’:
main.cpp:26: error: ‘QApplication’ was not declared in this scope
main.cpp:26: error: expected `;' before ‘app’
main.cpp:27: error: ‘QLabel’ was not declared in this scope
main.cpp:27: error: ‘label’ was not declared in this scope
main.cpp:27: error: expected type-specifier before ‘QLabel’
main.cpp:27: error: expected `;' before ‘QLabel’
main.cpp:29: error: ‘app’ was not declared in this scope
main.cpp: At global scope:
main.cpp:24: warning: unused parameter ‘argc’
main.cpp:24: warning: unused parameter ‘argv’
make[1]: *** [main.o] Error 1
make[1]: Target `first' not remade because of errors.
make: *** [sub-src-make_default] Error 2
make: Target `first' not remade because of errors.
*** Exited with status: 2 ***
My problem is if I go into the folder of my project and run qmake-qt4 -project and then qmake-qt4 test.pro (which is the name of my project) and then run make, it complies and then runs fine. What am I doing wrong??