在Android的NDK链接错误(未定义的参考`__cxa_end_cleanup“) [英] Linker errors in Android NDK (undefined reference to `__cxa_end_cleanup')
问题描述
我得到这个输出从同事在一组code加入后:
I'm getting this output after adding in a set of code from a colleague:
./obj/local/armeabi/objs/jniWrapper/native.o: In function `_Vector_base':
D:/opt/android-ndk/sources/cxx-stl/stlport/stlport/stl/_vector.h:73: undefined reference to `__cxa_end_cleanup'
./obj/local/armeabi/objs/jniWrapper/native.o:(.ARM.extab.text._ZNSt6vectorIhSaIhEEC1ERKS1_[std::vector<unsigned char, std::allocator<unsigned char> >::vector(std::vector<unsigned char, std::allocator<unsigned char> > const&)]+0x0): undefined reference to `__gxx_personality_v0'
./obj/local/armeabi/objs/jniWrapper/native.o: In function `std::__node_alloc::deallocate(void*, unsigned int)':
D:/opt/android-ndk/sources/cxx-stl/stlport/stlport/stl/_alloc.h:161: undefined reference to `__cxa_end_cleanup'
./obj/local/armeabi/objs/jniWrapper/native.o:(.ARM.extab.text._ZNSt4priv12_String_baseIcSaIcEED2Ev[std::priv::_String_base<char, std::allocator<char> >::~_String_base()]+0x0): undefined reference to `__gxx_personality_v0'
./obj/local/armeabi/objs/jniWrapper/native.o: In function `basic_string':
D:/opt/android-ndk/sources/cxx-stl/stlport/stlport/stl/_string.c:643: undefined reference to `__cxa_end_cleanup'
这是造成的,因为我没有获得正确的STL。
This is caused because I don't have access to the correct STL.
据我所知,只有三个,我可以从( stlport_static
, stlport_shared
,系统
)的设置由 APP_STL:在
Application.mk
>
To my knowledge there are only three I can choose from (stlport_static
, stlport_shared
, system
) as set by APP_STL := stlport_static
in Application.mk
.
有另一种可供NDK?
推荐答案
看完的Android NDK /文档/ CPLUSPLUS-SUPPORT.html
我发现有一对夫妇更
After reading android-ndk/docs/CPLUSPLUS-SUPPORT.html
I found that there a couple more libraries that I can link to:
C++ C++ Standard
Exceptions RTTI Library
system no no no
gabi++ no yes no
stlport no yes yes
gnustl yes yes yes
这会停止我的链接错误(和推动构建到一组新的错误:))
This stops my linker errors (and pushes the build onto a new set of errors :))
Application.mk
APP_STL := gnustl_static
这篇关于在Android的NDK链接错误(未定义的参考`__cxa_end_cleanup“)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!