qt的编译

cp qt-everywhere-opensource-src-5.5.0.tar.gz /opt/qt/
2.1 解压qt源码
sudo tar xzf qt-everywhere-opensource-src-5.5.0.tar.gz

2.2 修改编译的配置文件
gec@ubuntu:/opt/qt/qt-everywhere-opensource-src-5.5.0/qtbase/mkspecs/linux-arm-gnueabi-g++$
路径下修改qmake.conf 文件如下


#
# qmake configuration for building with arm-linux-gnueabi-g++
#

MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
QT_QPA_DEFAULT_PLATFORM = linuxfb #add cai

 

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

# modifications to g++.conf
QMAKE_CC = arm-linux-gcc
QMAKE_CXX = arm-linux-g++
QMAKE_LINK = arm-linux-g++
QMAKE_LINK_SHLIB = arm-linux-g++

# modifications to linux.conf
QMAKE_AR = arm-linux-ar cqs
QMAKE_OBJCOPY = arm-linux-objcopy
QMAKE_NM = arm-linux-nm -P
QMAKE_STRIP = arm-linux-strip
load(qt_config)

2.3 配置编译参数

sudo ./configure \
-prefix /opt/Qt-5.5.0-gec2015.11/ \
-confirm-license \
-opensource \
-release \
-make libs \
-xplatform linux-arm-gnueabi-g++ \
-optimized-qmake \
-pch \
-qt-sql-sqlite \
-qt-libjpeg \
-qt-libpng \   //表示要用到该库
-qt-zlib \
-tslib \
-no-opengl \   //no表示不使用
-no-sse2 \
-no-openssl \
-no-nis \
-no-cups \
-no-glib \
-no-dbus \
-no-xcb \
-no-xcursor -no-xfixes -no-xrandr -no-xrender \
-no-separate-debug-info \
-nomake examples -nomake tools -nomake tests -no-iconv \
-I/usr/local/tslib/include -L/usr/local/tslib/lib   //这里需要使用到tslib库

配置后的参数列表

 

2.4 编译
sudo make -j4 //使用四个线程来进行编译


2.5 安装
sudo make install

posted @ 2016-04-05 19:06  高傲的monkey  阅读(1049)  评论(0编辑  收藏  举报