Error Boost :: Spirit

I rarely ask about a compilation error, but the next error puzzled me.

I have successfully compiled boost libraries for Android, and I'm trying to use its Spirit library to create a parser. But when I tried to compile. I get the following errors.

Regarding the first error in endian.hpp, I think I need to include its cpu type (Android) in the file. But I have no idea why I get other errors. Any hint or hint would be appreciated.

  > 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
+4
source share
3 answers

It may be a little late, but it can be easily fixed by adding -D_LITTLE_ENDIAN to the mix.

+4
source

I think the answer to your question is here . It seems that Android just does not support std :: wstring. Nevertheless, I think that the Spirit should still work (if the final goal of the processor is set) only with type char - have you tried?

+1
source

I recently modified the endian.hpp patch described here.

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

works great

+1
source

Source: https://habr.com/ru/post/1388402/


All Articles