首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android-ndk-r8b编译c++代码报错,该如何处理

2012-09-04 
android-ndk-r8b编译c++代码报错ndk-build对整个工程编译,报错如下:Assembly codeCompile++ thumb : hell

android-ndk-r8b编译c++代码报错
ndk-build对整个工程编译,报错如下:

Assembly code
"Compile++ thumb : hello-jni <= hello-jni.cppIn file included from D:/CD/workplace/HelloJNI//jni/hello-jni.cpp:18:0:D:/android-ndk-r8b/platforms/android-3/arch-arm/usr/include/jni.h:592:13: note:the mangling of 'va_list' has changed in GCC 4.4StaticLibrary  : libstdc++.aSharedLibrary  : libhello-jni.soInstall        : libhello-jni.so => libs/armeabi/libhello-jni.so

.so文件可以生成,不过android程序执行报错退出。

Android.mk 如下:
C/C++ code
LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE    := hello-jniLOCAL_SRC_FILES := hello-jni.cppinclude $(BUILD_SHARED_LIBRARY)


这个测试程序并没有引用特定的库,所以可以把cpp改成c,再次编译运行无错。
求助这是怎么回事啊?
D:/android-ndk-r8b/platforms/android-3/arch-arm/usr/include/jni.h:592:13: note:
the mangling of 'va_list' has changed in GCC 4.4


[解决办法]
I think that the warning is accurate; the mangling of va_list has indeed changed on ARM in GCC 4.4 in order to conform to the ARM ABI specifications. There is an option to turn off warnings about PSABI issues; -Wno-psabi. I think that option (if not some stronger option) should be used.
[解决办法]
在Application.mk文件里加一句 NDK_TOOLCHAIN_VERSION=4.4.3

热点排行