android-lighthoust编译错误

本文档详细介绍了如何从源代码编译适用于Android平台的Qt库。具体步骤包括配置NDK路径、编译环境变量设定及解决编译过程中遇到的问题。

git clone git://gitorious.org/~taipan/qt/android-lighthouse.git 这个就是qt for android 源代码,下面将在此基础上编译基于android的qt库。

  • 修改androidconfigbuild.sh

ANDROID_NDK_ROOT 指向android ndk根目录

ANDROID_NDK_HOST设置为当前系统,比如mac os x上应该是darwin-x86

ANDROID_NDK_PLATFORM 设置为已安装的android sdk版本,比如android-15

注意要使用绝对路径,不要使用波浪号tilde当前用户前缀,否则以后gcc -I包括头文件路径时会找不到。下面是mac os x下的片段:

export ANDROID_NDK_ROOT=/lib/android-ndk-r8e

export ANDROID_NDK_HOST=darwin-x86_64

export ANDROID_NDK_TOOLCHAIN_PREFIX=arm-linux-androideabi

export ANDROID_NDK_TOOLCHAIN_VERSION=4.4.3

export ANDROID_NDK_PLATFORM=android-15

  • 修改mkspecs/android-g++/qmake.conf

将以上androidconfigbuild.sh中所做的修改也应用在这里,因为qmake生成Makefile时需要这些hardcode路径

执行脚本androidconfigbuild.sh,编译qt for android,然后我注释掉make相关 的。自己make -j4编译。碰到下面问题。

../../include/QtCore/../../src/corelib/tools/qlist.h:412: error: no matching function for call to 'operator new(unsigned int, QList<QFutureCallOutInterface*>::Node*&)'
<built-in>:0: note: candidates are: void* operator new(unsigned int)
../../include/QtCore/../../src/corelib/tools/qlist.h:423: error: 'memcpy' was not declared in this scope
make[1]: *** [.obj/release-shared/qfutureinterface.o] 错误 1
make[1]:正在离开目录 `/home/baimingyong/下载/android-lighthouse/src/corelib'
make: *** [sub-corelib-make_default-ordered] 错误 2



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值