ubuntu qt编译环境搭建
1、安装一些必要的编译工具:
sudo apt-get install autoconf automake libtool
2、下载qt的源代码并解压:
wget-c
http://mirrors.hust.edu.cn/qtproject/archive/qt/4.8/4.8.3/qt-everywhere-opensource-src-4.8.3.tar.gz
tarxvf qt-everywhere-opensource-src-4.8.3.tar.gz && cdqt-everywhere-opensource-src-4.8.3/
3、编译qt
(
1
)编译
PC
版
./configure-prefix /usr/local/qt-4.8.3-pc -opensource && make &&sudo make install
(
2
)编译
X86
版
./configure-prefix/usr/local/qt-4.8.3-x86 -opensource
-confirm-license-release -shared -embedded x86 -qvfb -fast -no-qt3support
make&& sudo make install
(
3
)
ARM
版
./configure-opensource -confirm-license -release -shared -embedded arm-xplatform qws/linux-arm-g++ -depths 4,8,16,18,24,32 -fast-optimized-qmake -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng-qt-freetype -little-endian -host-little-endian -no-qt3support-no-libtiff -no-libmng -no-opengl -no-mmx -no-sse -no-sse2 -no-3dnow-no-openssl -no-webkit -no-qvfb -no-phonon -no-nis -no-cups -no-glib-no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info-nomake examples -nomake tools -nomake docs -qt-mouse-tslib-I/usr/local/tslib/include -L/usr/local/tslib/lib -D__ARM_ARCH_4T__
注:如果是
6410
,最后一行应为
-D__ARM_ARCH_5TEJ__
修改配置文件qt-everywhere-opensource-src-4.7.3/mkspecs/qws/linux-arm-g++/qmake.conf中的
QMAKE_CC、QMAKE_CXX、QMAKE_LINK、QMAKE_LINK_SHLIB的值改为arm-linux-g++-lts
make&& sudo make install
注:
-opensource
开源版本
-release
编译
Qt
以发布版的模式进行
-shared
指
Qt
的
lib
以动态编译生成
-embeddedx86
以
x86
体系架构编译
-qvfb
支持
pc
上使用
qvfb
模拟
-fast
加快编译的速度
-no-qt3support
不加对
qt3
的支持