簡體   English   中英

Boost :: Spirit編譯錯誤

[英]Boost::Spirit compilation error

我很少問及編譯錯誤,但是我遇到了一些錯誤。

我成功編譯了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

也許它有點晚了,但可以通過添加-D_LITTLE_ENDIAN來輕松修復。

我最近用這里描述的補丁修改了我的endian.hpp

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

效果很好

我想你問題的答案就在這里 似乎Android根本不支持std :: wstring。 但是,我認為Spirit應該仍然​​可以工作(假設已經設置了CPU結束),只有char類型 - 你試過嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM