Boost::Spirit编译错误

Boost::Spirit compilation error

本文关键字:错误 编译 Spirit Boost      更新时间:2023-10-16

我很少问编译错误,但以下几种错误让我困惑。

我成功地编译了Android的boost库,我正试图使用它的Spirit库来构建一个解析器。但是当我试着编译。我得到以下错误:

关于endian.hpp中的第一个错误,我想我需要在文件中包含其cpu类型(Android)。但我不知道为什么我得到其他错误。如有任何提示或提示,我将不胜感激。

<>之前>在文件中包含from> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/精神/home/支持/细节/整数/endian.hpp: 37岁>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/home/support/detail/endan .hpp:24,>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/home/qi/binary/binary.hpp:16,>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/home/qi/binary.hpp:14,>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/home/qi.hpp:18,>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/include/qi.hpp:16,>从D:/mywork/dev/eclWork/BoostTest/jni/ndkfoo.cpp:24:> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/细节/endian.hpp: 74:3:文件boost/detail/endian.hpp需要设置> CPU类型。文件中包括> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/精神/home/气/directive.hpp: 14日>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/home/qi.hpp:19,>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/include/qi.hpp:16,>从D:/mywork/dev/eclWork/BoostTest/jni/ndkfoo.cpp:24:> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/精神/home/气/指令/as.hpp: 128:>错误:'wstring'不是'std'的成员> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/精神/home/气/指令/as.hpp: 128:>错误:'wstring'不是'std'的成员> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/精神/home/气/指令/as.hpp: 128:>错误:模板参数2无效> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/数学/special_functions/fpclassify.hpp: 20,>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/home/support/detail/sign.hpp:22,>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/home/qi/numeric/detail/real_impl.hpp:22,>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/home/qi/numeric/real.hpp:21,>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/home/qi/numeric.hpp:17,>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/home/qi.hpp:21,>从C:/program ~1/Android/Android -ndk-r6b/sources/boost/boost/spirit/include/qi.hpp:16,>从D:/mywork/dev/eclWork/BoostTest/jni/ndkfoo.cpp:24:> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/数学/special_functions/细节/fp_traits.hpp: 472:>错误:对不完整类型使用sizeof无效>"boost:: STATIC_ASSERTION_FAILURE"> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/数学/special_functions/细节/fp_traits.hpp:在静态成员函数'static void '中> boost::math::detail::fp_traits_non_native boost::math::detail::extended_double_precision>::get_bits(long double;> uint32_t&)":> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/数学/special_functions/细节/fp_traits.hpp: 457:> error: 'offset_'未在此范围内声明> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/数学/special_functions/细节/fp_traits.hpp:在静态成员函数'static void '中> boost::math::detail::fp_traits_non_native boost::math::detail::extended_double_precision>::set_bits(长> double&, uint32_t)':> C:/Progra ~ 1/Android/android-ndk-r6b/资源/提高/提高/数学/special_functions/细节/fp_traits.hpp: 462:> error: 'offset_'未在此范围内声明。make: ***> [/mywork/dev/eclWork cygdrive/d//提高/obj/地方/armeabi/obj/ndkfoo/ndkfoo.o]>错误1

也许这有点晚了,但这可以通过添加-D_LITTLE_ENDIAN来轻松修复。

我最近用这里描述的补丁修改了我的endian.hpp

https://github.com/MysticTreeGames/Boost-for-Android/commit/8e2a1811445c077bc42f9d241cf0546f707786f3

伟大作品

我想你的问题的答案在这里。Android似乎就是不支持std::wstring。然而,我认为精神仍然应该工作(给定CPU端序设置)仅与char类型-你试过吗?