Hi,

I am new to Qt.
I have installed Qt_SDK_Lin32_offline_v1_1_2_en.run. It has installed successfuly.
When i have created Qt application from Qt IDE, it is building and running but same application is giving error when i try to compile it from terminal.
My code is

.pro file:
Qt Code:
  1. SOURCES = main.cpp
  2. # install
  3. sources.files = $$SOURCES *.pro
  4. INSTALLS += target sources
  5. DESTDIR = release
  6. TARGET = Demo
To copy to clipboard, switch view to plain text mode 
main.cpp
Qt Code:
  1. #include <QApplication>
  2. #include <QLabel>
  3. int main(int argc, char *argv[])
  4. {
  5. QApplication app(argc, argv);
  6. QLabel *label = new QLabel("Hello Qt!");
  7. label->setPixmap(QPixmap(200, 50));
  8. label->show();
  9. return app.exec();
  10. }
To copy to clipboard, switch view to plain text mode 
but when i try to compile same project from command line using qmake and make command then it is giving following error.
Qt Code:
  1. $qmake
  2. WARNING: target.path is not defined: install target not created
  3. WARNING: sources.path is not defined: install target not created
  4.  
  5. $make
  6. g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -o main.o main.cpp
  7. main.cpp:1:24: fatal error: QApplication: No such file or directory
  8. compilation terminated.
  9. make: *** [main.o] Error 1
To copy to clipboard, switch view to plain text mode 

I have compiled another project which is working fine in command line on another system with qmake and make. It is not giving any warning while qmake but giving same error while make.

.pro file for another project is
Qt Code:
  1. SOURCES = main.cpp
  2. # install
  3. target.path = Demo
  4. sources.files = $$SOURCES *.pro
  5. sources.path = .
  6. INSTALLS += target sources
To copy to clipboard, switch view to plain text mode 
main.cpp is same for both.

Please help me to solve this.
Thanks