First, the Environment configuration
Dependent software:
Please read the Readme file in detail and install the dependent package
Qt-everywhere-opensource-src-5.3.2/readme
Qtbase/src/plugins/platforms/xcb/readme
QT Version: qt-everywhere-opensource-src-5.3.2
Configuration files, ~/.BASHRC and ~/.profile
Path configuration: #这个是我安装并配置Qt之后的完整的配置路径
Export path=/usr/local/qt-5.3. 2/qtbase/bin: $PATHexportmake =/usr/bin/makeexport Ld_library_path=/usr/local /qt-5.3. 2/qtbase/lib
Second, the installation process
1, first install the Gcc,make,tar, tools, and then install the corresponding dependent packages.
2, by installing QT before you need to configure the path as follows:
Export path=/usr/local/qt-5.3. 2/qtbase/bin: $PATH #源码qt中qmake位置exportmake =/usr/bin/make #当不能识别make时, Specify the path
3, installation process:
CD <path>/qt-everywhere-opensource-src-<version>. /configure-prefix $PWD/qtbase-opensource-nomake testsmake4
4. Configure the path after QT installation
Export path=/usr/local/qt-5.3. 2/qtbase/bin: $PATHexportmake =/usr/bin/makeexport Ld_library_path=/usr/local /qt-5.3. 2/qtbase/lib
Third, the use of instructions
1. Use the command in the current source file directory (Test.cpp) to generate a platform-independent project file Test.pro
Qmake–project
2. Generate a platform-related makefile file from the project file
Qmake Test.pro
3. Build the program
Make
Note: The resulting pro file needs to be added with the appropriate components
Test.cpp Source
#include <QApplication><QLabel>int main (intChar* argv[]) { qapplication app (argc, argv); New Qlabel ("hello Qt"); Label, Show (); return app.exec ();}
Corresponds to the generated Hello.pro
####################################################################### automatically generated by Qmake ( 3.0 + at:= == =++ + test.cpp
Where you need to add components
QT +=4): qt + = Widgets
Otherwise the error
Reference:
Adding components
Http://bbs.csdn.net/topics/390658864?page=1
Ubuntu 14.04 LTS installs Qt 5.3.2