noob having problems to compile first Qt "hello world" application
I'm trying to compile the next Qt code:
Code:
#include <qapplication.h> Code:
hello.cpp:1:125: error: qapplication.h: No such file or directory Code:
joakim@leho:~/qt$ g++ -Wall -I/usr/include/qt4/Qt -L/usr/lib hello.cpp -l hello -lqt Code:
joakim@leho:~/qt$ find /usr/ -iname qcoreapplication.h |
Try #include <QApplication> etc.
Have you tried compiling Qt examples to make sure Qt is correctly installed? |
Have you tried using qmake in the directory with the hello.cpp? Try this...
1) qmake -project 2) qmake 3) make 4) ./hello Bill |
sir,hav made the following code:
#include <QApplication> #include <QPushButton> int main( int argc, char **argv ) { QApplication a( argc, argv ); QPushButton hello( "Hello world!", 0 ); hello.resize( 100, 30 ); a.setMainWidget( &hello ); hello.show(); return a.exec(); } n got the same errors as my frnd joakim12 is getting...QApplication :no such file or directory etc..etc.. sir help me..how to correct these errors..i hav to make my project using Qt..waiting 4 ur reply...ASAP |
1. This thread is 4 years old
2. I hardly understand a word of what you said. |
All times are GMT -5. The time now is 09:54 AM. |