gpt4 book ai didi

android - Android NDK 中的链接器错误(对 `__cxa_end_cleanup' 的 undefined reference )

转载 作者:IT王子 更新时间:2023-10-28 23:29:44 30 4
gpt4 key购买 nike

在添加同事的一组代码后,我得到了这个输出:

./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。

据我所知,我只能从 APP_STL 设置的三个(STLport_staticSTLport_sharedsystem)中选择: = Application.mk 中的 STLport_static

NDK 是否有其他库可用?

最佳答案

阅读 android-ndk/docs/CPLUSPLUS-SUPPORT.html 后,我发现我可以链接到更多库:

             C++       C++   Standard
Exceptions RTTI Library

system no no no
gabi++ no yes no
stlport no yes yes
gnustl yes yes yes

这会阻止我的链接器错误(并将构建推送到一组新的错误:))

Application.mk

APP_STL := gnustl_static

关于android - Android NDK 中的链接器错误(对 `__cxa_end_cleanup' 的 undefined reference ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9226513/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com