1. According to C + + GUI QT4 Programming (second edition) finishing
2. System: CENTOS7; QT version: 5.5.1
3. Procedure: Hello.cpp
#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 ();}
4. Qmake using aliases: $ alias qmake= "/opt/qt/qt5.5.1/5.5/gcc_64/bin/qmake"
5. Build platform-Independent project files: $ qmake-project
6. Generate platform-related makefile files: $ qmake 1.1.pro
7. Build the program to generate the executable program: $ make
8. Run the program: $./1.1
Note: 1.1 is the folder name
Summary of issues:
1. Hello.cpp:1:24: Fatal error: qapplication: no file or directory
Workaround: Open the 1.1.pro file and add the following 2 lines:
QT + + Core GUI
GreaterThan (Qt_major_version, 4): QT + = Widgets
C + + GUI QT4 programming ( -1.1hello) Qt