2

ブースト ロギングが必要なコードをコンパイルしようとしましたが、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  

ブースト ライブラリのバージョン: 1.54.0

9c と 10b の両方の Android ndk でアプリをビルドしようとしましたが、違いはありませんでした。

4

1 に答える 1

3

/boost/include/boost/log/utility/type_info_wrapper.hpp:131:33: エラー: '__cxa_demangle' は 'abi' のメンバーではありません

NDK を見ると、doc/CPLUSPLUS-SUPPORT.htmlそれについての言及はありません。4つの選択肢があるようです。

まず、 Boost 1.56type_info_wrapper.hppを使用していないように見えるため、使用できる可能性があります__cxa_demangle。私は間違っているかもしれませんが、1.56 ヘッダーには見つかりませんでした。

次に、未定義の Boost 1.54 を設定しBOOST_LOG_HAS_CXXABI_Hます。これにより、1.54 の の使用が保護されます。abi::__cxa_demangletype_info_wrapper.hpp

Boost はめったに使わないのでどうすればいいのかわかりませんが、おそらくconfig.hpp次のようにハックするでしょう。Boost 関係者はbjam構成オプションを知っている可能性があるため、そのうちの 1 人がフィードバックを提供してくれることを願っています。

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

第三に、それを提供するライブラリの 1 つとリンクしてみてください。残念ながら、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

__cxa_demangle4 番目に、それを提供する STL ライブラリの 1 つから移植します。NDK ライブラリのソースコードはAndroid Tools Projectにあります。

于 2014-09-14T18:21:44.873 に答える