Compiling and linking error when using NDK r10 to build cocos2d-x v3.2
来源:互联网 发布:php 格式化百分比 编辑:程序博客网 时间:2024/06/06 02:43
By zhangxm Posted about 2 hours ago
If you use NDK r10 to build cocos2d-x v3.2, you will meet a compiling error of all tests and linking error of lua tests.
compiling error
The error message is
This compiling error is fixed in this patch. We are sorry about it.
linking error
After fixing the compiling error, you will meet linking error when building lua test cases or new lua projects
I have created a ticket in Android issue system for it. And NDK developers confirmed it is a bug of NDK r10. And he gave two ways to work around it:
requires makefile changes to drop libgcc.a with command line reads "-nodefaultlibs -lstdc++ -latomic -ldl -lm -lc -lcompiler_rt_static"
Because we don't use standalone toolchain, so changing makefile doesn't work for cocos2d-x.
use libc++_shared.so and add
LIBCXX_USE_GABIXX:=true
in Application.mk which force rebuild libc++ to use gabi++This method requires to use shared library and modify
Cocos2dxActivity.java
to load dependened shared library. We don't want to modify like this, because:- We haven't used shared library before which means we haven't tested
- It will make .apk 0.13M bigger then using static library
- Google guy will fix it in next NDK version
conclusion
We suggest you not to use NDK r10. Please use NDK r9d instead.
If you want to use NDK r10, the following steps can help you work around it:
- Change
long int
tossize_t
in the declaration ofBundleReader::tell()
. You can refer to this pull request for detail information. - Change
APP_STL:=c++_static
toAPP_STL:=c++_shared
, addLIBCXX_USE_GABIXX:=true
inApplication.mk
, and modify your java activity code to loadlibc++_shared.so
. You can refer to this commit for more detail information
- Compiling and linking error when using NDK r10 to build cocos2d-x v3.2
- Compiling and linking error when using NDK r10 to build cocos2d-x v3.2
- Compiling and linking error when using NDK r10 to build cocos2d-x v3.2
- 使用NDK r10构建Cocosd-x v3.2时编译和链接错误的解决办法
- fix the elipse compiling err when using memcpy in cocos2d-x
- Error: Program "C:\android\android-ndk-r10\ndk-build.cmd" not found in PATH
- ARC error when compiling
- Compiling, Linking and Debugging Tips for C++
- CImg Library's Examples Compiling and Linking
- CImg Library's Examples Compiling and Linking
- Error when using imshow on OS X
- Process 'command 'D:\android-ndk-r10\ndk-build.cmd'' finished with non-zero exit value 2
- Process 'command 'D:\android-ndk-r10\ndk-build.cmd'' finished with non-zero exit value 2
- Using Android Studio to build applications with NDK and Boost C++ libraries
- cmake error when compiling ros_rt_wmp
- cocos2d-x v3.3 Hide and Show
- How to solve the linking errors when using the ATOMIC functions
- How to check crash log using android ndk in cocos2d-x
- 编译hadoop 2.4.1 源代码以及 libhadoop.so.1.0.0文件
- 跨域请求XDomainRequest
- rectangle函数matlab
- HDU4869 多校
- 笔记——Java基础[03-面向继承(上)]
- Compiling and linking error when using NDK r10 to build cocos2d-x v3.2
- Git源码学习(一)
- Step by Step Setup Git Server on Windows with CopSSH + msysGit and Integrate Git with Visual Studio
- Sort List(LeetCode)
- 闪回恢复误删除对象
- C++中常见的错误 (总结)
- WebView与js的数据交互
- memcache介绍及其安装
- 凸边形外壳(求凸包面积)