首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >STLport错误:“__cxa_demangle”不是boost库的“abi”成员

STLport错误:“__cxa_demangle”不是boost库的“abi”成员
EN

Stack Overflow用户
提问于 2014-09-14 18:04:18
回答 1查看 1.8K关注 0票数 2

我一直在尝试编译一段需要boost日志记录的代码,当我尝试用gnustl编译时,情况会很好,但是当我切换到stlport编译器时,就会发出下面的消息。

代码语言:javascript
运行
复制
In file included from   /boost/include/boost/log/attributes/attribute_value.hpp:23:0,
                 from /boost/include/boost/log/attributes/attribute_value_set.hpp:27,
                 from  /boost/include/boost/log/core/record.hpp:21,
                 from  /boost/include/boost/log/core/core.hpp:23,
                 from  /boost/include/boost/log/core.hpp:20,
                 from  /boost/include/boost/log/common.hpp:22,
                 from /MyApp/FrameWorkLog.cpp:30:
 /boost/include/boost/log/utility/type_info_wrapper.hpp: In member function 'std::string boost::log::v2s_mt_posix::type_info_wrapper::pretty_name() const':
 /boost/include/boost/log/utility/type_info_wrapper.hpp:131:33: error: '__cxa_demangle' is not a member of 'abi'

我不想使用gnustl有很多原因。

更多信息:下面是我的Application.mk文件

代码语言:javascript
运行
复制
NDK_TOOLCHAIN_VERSION=4.6
APP_ABI := armeabi-v7a
APP_PLATFORM := android-14
APP_STL := stlport_static  # For Static build
APP_CPPFLAGS := -frtti -fexceptions  

Boost库版本: 1.54.0

我试着开发我的应用程序9c和10b android,但没有区别。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-09-14 18:21:44

/boost/include/boost/log/utility/type_info_wrapper.hpp:131:33:错误:'__cxa_demangle‘不是'abi’的成员

看看NDK的doc/CPLUSPLUS-SUPPORT.html,就没有提到它了。看来你有四个选择。

首先,您可能能够使用Boost 1.56,因为它似乎type_info_wrapper.hpp不使用__cxa_demangle。我可能是错的,但我没有在1.56头球中找到它。

其次,配置Boost 1.54,使BOOST_LOG_HAS_CXXABI_H不被定义。这将保护abi::__cxa_demangle在1.54的type_info_wrapper.hpp中的使用。

我不知道如何做到这一点,因为我很少使用Boost,但是我可能会通过config.hpp将其黑客化如下。Boost用户可能知道一个bjam配置选项,因此希望他们中的一个能够提供反馈。

代码语言:javascript
运行
复制
// cxxabi.h availability macro
#if defined(BOOST_CLANG)
#   if defined(__has_include) && __has_include(<cxxabi.h>)
#       define BOOST_LOG_HAS_CXXABI_H
#   endif
#elif defined(__GNUC__) && !defined(__QNX__)
#   define BOOST_LOG_HAS_CXXABI_H
#endif

// Add these lines as a hack
#ifdef (__ANDROID__)
# undef BOOST_LOG_HAS_CXXABI_H
#endif

第三,尝试与其中一个提供它的库进行链接。不幸的是,它看起来不像是STLport提供的。看来GAbi++和GNU STL提供了:

代码语言:javascript
运行
复制
$ cd /opt/android-ndk-r9/
$ find . -iname cxxabi.h
./sources/cxx-stl/gabi++/include/cxxabi.h
./sources/cxx-stl/gnu-libstdc++/4.4.3/include/cxxabi.h
./sources/cxx-stl/gnu-libstdc++/4.6/include/cxxabi.h
./sources/cxx-stl/gnu-libstdc++/4.7/include/cxxabi.h
./sources/cxx-stl/gnu-libstdc++/4.8/include/cxxabi.h

第四,从提供它的STL库中移植__cxa_demangle。您可以在Android工具项目上找到NDK库的源代码。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25836364

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档