Android Boost::Spirit编译错误

Android Boost::Spirit编译错误,android,c++,boost-spirit,Android,C++,Boost Spirit,我很少问编译错误,但下面这种错误让我感到困惑 我成功地编译了Android的boost库,并尝试使用它的Spirit库来构建解析器。但是当我试图编译的时候。我得到以下错误 至于endian.hpp中的第一个错误,我想我需要在文件中包含它的cpu类型(Android)。但我不知道为什么会出现其他错误。任何线索或暗示都将不胜感激 > In file included from > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spir

我很少问编译错误,但下面这种错误让我感到困惑

我成功地编译了Android的boost库,并尝试使用它的Spirit库来构建解析器。但是当我试图编译的时候。我得到以下错误

至于endian.hpp中的第一个错误,我想我需要在文件中包含它的cpu类型(Android)。但我不知道为什么会出现其他错误。任何线索或暗示都将不胜感激

> In file included from > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/support/detail/integer/endian.hpp:37, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/support/detail/endian.hpp:24, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi/binary/binary.hpp:16, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi/binary.hpp:14, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi.hpp:18, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/include/qi.hpp:16, > from D:/mywork/dev/eclWork/BoostTest/jni/ndkfoo.cpp:24: > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/detail/endian.hpp:74:3: > error: #error The file boost/detail/endian.hpp needs to be set up for > your CPU type. In file included from > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi/directive.hpp:14, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi.hpp:19, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/include/qi.hpp:16, > from D:/mywork/dev/eclWork/BoostTest/jni/ndkfoo.cpp:24: > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi/directive/as.hpp:128: > error: 'wstring' is not a member of 'std' > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi/directive/as.hpp:128: > error: 'wstring' is not a member of 'std' > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi/directive/as.hpp:128: > error: template argument 2 is invalid In file included from > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/math/special_functions/fpclassify.hpp:20, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/support/detail/sign.hpp:22, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi/numeric/detail/real_impl.hpp:22, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi/numeric/real.hpp:21, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi/numeric.hpp:17, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/home/qi.hpp:21, > from C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/spirit/include/qi.hpp:16, > from D:/mywork/dev/eclWork/BoostTest/jni/ndkfoo.cpp:24: > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/math/special_functions/detail/fp_traits.hpp:472: > error: invalid application of 'sizeof' to incomplete type > 'boost::STATIC_ASSERTION_FAILURE' > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/math/special_functions/detail/fp_traits.hpp: > In static member function '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/sources/boost/boost/math/special_functions/detail/fp_traits.hpp:457: > error: 'offset_' was not declared in this scope > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/math/special_functions/detail/fp_traits.hpp: > In static member function 'static void > boost::math::detail::fp_traits_non_native boost::math::detail::extended_double_precision>::set_bits(long > double&, uint32_t)': > C:/Progra~1/Android/android-ndk-r6b/sources/boost/boost/math/special_functions/detail/fp_traits.hpp:462: > error: 'offset_' was not declared in this scope make: *** > [/cygdrive/d/mywork/dev/eclWork/BoostTest/obj/local/armeabi/objs/ndkfoo/ndkfoo.o] > Error 1 >在文件中包括从 >C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/support/detail/integer/endian.hpp:37, >来自C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/support/detail/endian.hpp:24, >来自C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/qi/binary/binary.hpp:16, >来自C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/qi/binary.hpp:14, >来自C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/qi.hpp:18, >来自C:/Progra~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/sources/boost/boost/detail/endian.hpp:74:3: >错误:#错误需要为其设置boost/detail/endian.hpp文件 >您的CPU类型。在文件中包括从 >C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/qi/directive.hpp:14, >来自C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/qi.hpp:19, >来自C:/Progra~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/sources/boost/boost/spirit/home/qi/directive/as.hpp:128: >错误:“wstring”不是“std”的成员 >C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/qi/directive/as.hpp:128: >错误:“wstring”不是“std”的成员 >C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/qi/directive/as.hpp:128: >错误:模板参数2在中包含的文件中无效 >C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/math/special_functions/fpclassify.hpp:20, >来自C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/support/detail/sign.hpp:22, >来自C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/qi/numeric/detail/real_impl.hpp:22, >来自C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/qi/numeric/real.hpp:21, >来自C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/qi/numeric.hpp:17, >来自C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/spirit/home/qi.hpp:21, >来自C:/Progra~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/sources/boost/boost/math/special_functions/detail/fp_traits.hpp:472: >错误:“sizeof”对不完整类型的应用无效 >'boost::静态\u断言\u失败' >C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/math/special_functions/detail/fp_traits.hpp: >在静态成员函数的静态void中 >boost::math::detail::fp_traits_非本机boost::math::detail::extended_double_precision>::获取位(长双精度、, >uint32_t&'): >C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/math/special_functions/detail/fp_traits.hpp:457: >错误:未在此作用域中声明“偏移量” >C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/math/special_functions/detail/fp_traits.hpp: >在静态成员函数的静态void中 >boost::math::detail::fp\u traits\u非本地boost::math::detail::extended\u double\u precision>::set\u位(长) >双(,uint32_t)’: >C:/Progra~1/Android/Android-ndk-r6b/sources/boost/boost/math/special_functions/detail/fp_traits.hpp:462: >错误:未在此作用域中声明“偏移量”:*** >[/cygdrive/d/mywork/dev/eclWork/BoostTest/obj/local/armeabi/objs/ndkfoo/ndkfoo.o] >错误1
我想你的问题的答案是。Android似乎根本不支持std::wstring。但是,我认为Spirit应该仍然可以工作(设置了CPU endianess)仅使用
char
类型-您尝试过了吗?

可能有点晚了,但是可以通过在混合中添加-D_LITTLE_ENDIAN轻松解决这个问题。

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


效果很好

最好的建议就是远离精神。还有很多其他选择。@JaredKrumsie谢谢。我倾向于那条路。你对其他选择有什么建议吗?这取决于你的问题有多复杂,这些问题没有解决的办法。很高兴知道。不,我还没有试过,但我会在某个时候试一下。谢谢我添加了这个指令,破坏了很多标准,在我的案例中是成功的。