http://www.xuebuyuan.com/1659702.html
1. 按照脚本中指示,配置ANDROID_NDK ANDROID_SDK 环境变量;
2. 脚本中检测 ndk9 和gcc 4.8 过时了,修改脚本
3. 在要编译的目录下 检测Application.mk 的sdk 和 gcc 版本,同时修改添加
-Werror=format-security 将警告错误检测,跳过。
4. ndk-r10 搞半天 ,最后换回ndk-r9d 了, 悲催了好久;
Android NDK: WARNING: Rebuilding STLport libraries from sources!
Android NDK: You might want to use $NDK/build/tools/build-cxx-stl.sh --stl=stlport
Android NDK: in order to build prebuilt versions to speed up your builds!
[armeabi-v7a] Compile thumb : ijkadk <= ijkadk_android_os_bundle.c
[armeabi-v7a] Compile thumb : ijkadk <= ijkadk.c
[armeabi-v7a] Compile++ thumb: stlport_shared <= dll_main.cpp
In file included from /Users/wangkun/Applications/android-ndk-r10/sources/cxx-stl/stlport/src/dll_main.cpp:73:0:
/Users/wangkun/Applications/android-ndk-r10/sources/cxx-stl/stlport/stlport/stl/_stdexcept_base.c: In constructor 'std::__Named_exception::__Named_exception(const string&)':
/Users/wangkun/Applications/android-ndk-r10/sources/cxx-stl/stlport/stlport/stl/_stdexcept_base.c:28:56: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
*(__REINTERPRET_CAST(size_t*, &_M_static_name[0])) = __size * sizeof(char);
^
/Users/wangkun/Applications/android-ndk-r10/sources/cxx-stl/stlport/stlport/stl/_stdexcept_base.c: In copy constructor 'std::__Named_exception::__Named_exception(const std::__Named_exception&)':
/Users/wangkun/Applications/android-ndk-r10/sources/cxx-stl/stlport/stlport/stl/_stdexcept_base.c:51:56: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
*(__REINTERPRET_CAST(size_t*, &_M_static_name[0])) = __size * sizeof(char);
^
/Users/wangkun/Applications/android-ndk-r10/sources/cxx-stl/stlport/stlport/stl/_stdexcept_base.c: In member function 'std::__Named_exception& std::__Named_exception::operator=(const std::__Named_exception&)':
/Users/wangkun/Applications/android-ndk-r10/sources/cxx-stl/stlport/stlport/stl/_stdexcept_base.c:67:100: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
size_t __buf_size = _M_name != _M_static_name ? *(__REINTERPRET_CAST(size_t*, &_M_static_name[0])) : static_cast<size_t>(_S_bufsize);
^
In file included from /Users/wangkun/Applications/android-ndk-r10/sources/cxx-stl/stlport/src/dll_main.cpp:73:0:
/Users/wangkun/Applications/android-ndk-r10/sources/cxx-stl/stlport/stlport/stl/_stdexcept_base.c:77:56: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
*(__REINTERPRET_CAST(size_t*, &_M_static_name[0])) = __size * sizeof(char);
在Application.mk里面添加下面代码
APP_CPPFLAGS += -Wno-error=format-security