我一直在尝试编译一段需要boost日志记录的代码,当我尝试用gnustl编译时,情况会很好,但是当我切换到stlport编译器时,就会发出下面的消息。
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文件
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,但没有区别。
发布于 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
配置选项,因此希望他们中的一个能够提供反馈。
// 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提供了:
$ 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库的源代码。
https://stackoverflow.com/questions/25836364
复制相似问题