支持Arm编译的QT版本
1. ARM平台运行Ubuntu系统,如何选择Qt编译器
先找到可以编译arm的gcc(或者自己编译),然后再用这个arm版的gcc编译Qt程序。
2. 如何用qt-4.8.5源代码配置arm版本qt
下面是编译选项,自己可以修修改改
./configure -opensource -embedded arm
-xplatform qws/linux-arm-gnueabi-g++ -no-webkit -qt-libtiff -qt-libmng
-qt-libjpeg -qt-libpng -no-qt3support -nomake demos -nomake docs -nomake
examples -little-endian -host-little-endian -no-xcursor
-no-mouse-linuxtp -qt-mouse-tslib -I/usr/local/tslib/include
-L/usr/local/tslib/lib -fast -lrt -confirm-license
PS:
在解压包的
mkspecs/linux-arm-gnueabi-g++ 目录下需要配置一下你的 linux-arm-gnueabi-g++
路径,最好是设置成绝对路径,否则可能你配置的交叉编译器没有添加到环境变量里面不好~ (如果配置了环境变量的话,那就没必要设置了)
我的给你参考一下,就是原配了~
#
# qmake configuration for building with arm-linux-gnueabi-g++
#
MAKEFILE_GENERATOR = UNIX
TARGET_PLATFORM = unix
TEMPLATE = app
CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index
QT += core gui
QMAKE_INCREMENTAL_STYLE = sublib
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
# modifications to g++.conf
QMAKE_CC = arm-linux-gnueabi-gcc
QMAKE_CXX = arm-linux-gnueabi-g++
QMAKE_LINK = arm-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-linux-gnueabi-g++
# modifications to linux.conf
QMAKE_AR = arm-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-linux-gnueabi-obj
QMAKE_STRIP = arm-linux-gnueabi-strip
load(qt_config)
接下来是QT CREATE配置
工具-->选项--->构建和运行
1. 编译器: 点击添加: "名称"随意
"编译器路径" **/arm-none-linux-gnueabi-g++
找到你的编译器,我这里是用ARM的
其他不填也行.
2.Qt Versions: 点击添加:找到通过源码编译好的qmake文件. 例如:/usr/local/Qt-4.8.6/bin/qmake
3.构建套件: 点击添加: "名称"随意, 重点是 "编译器"跟"QT版本", 分别选择刚刚添加的两项.
调试器:如果是桌面环境那就选桌面的, 如果是在嵌入式中的,那不要也可以..
3. qt arm 版本编译问题
这个警告
> This however does *not* affect NDK-generated code because, very fortunately,
> none of the stable ABIs exposed by the NDK depend on this mangling (this has
> been checked carefully), so whichever toolchain you use, your code will run
> on all Android systems
赶脚不会对代码有什么影响啊..
CFLAGS += -Wno-psabi
关掉它就ok
4. linux 下用arm体系QT编译问题(目前我系统里有X86 和 arm体系(老师编好的)的QT各一个)
貌似是缺少系统库,有些版本的linux编译qt是会出现缺少系统库而导致编译不成功的问题,不是很推荐用最新的编译器来编译,其实2.4的内核和3.4.5的编译器做qt就已经足够了,你可以去查查看那些版本的linux下可以成功的编译qt,安装的时候尽可能把开发用的库都选上,不然就只有自己再去打补丁,
仅作参考