c++ - error while compiling boost in android -
I'm trying to install 1.5 according to 1.5.
When I compile, I get an error here is a piece of compilation error:
gcc.compile.c ++ bin.v2 / libs / thread / Build / gcc- and roid4.4.3 / release / link-static / runtime-link-static / threading-multi / pthread / thread.o & lt; Command-line>: Warning: "BOOST_FILESYSTEM_VERSION" redefined & lt; Command Line: Warning: This is the location of the previous definitions included in the file ./boost/thread/thread.hpp17, from Libs / Thread / src / pthread / thread.cpp: 11: ./boost/thread/pthread /thread_data.hpp: 'zero promotion :: thread_editers :: set_stack_size (size_t)' in member function: ./boost/thread/pthread/thread_data.hpp:42: error: 'PAGE_SIZE' was not declared in this scope " ../../toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86 / bin / arm-linux-androideabi-g ++ "-ftemplate-depth-128 -O3 -finline-functions -Wno -inline -Wall -pedantic --sysroot = .. / .. / platform / Android-9 / arc-arm-MTM-OS-F O-strict-aliasing-O2 -DNEBUG-G-LSTCC ++ -i .. /../ Source / CX-STL / GNU-LibStDC ++ / In-Eye /../ Source / CX-STL / gnu-libstdc ++ / L IBS / armeabi / include -D__GLIBC__ -DBOOST_NO_INTRINSIC_WCHAR_T -DBOOST_FILESYSTEM_VERSION = 2 -pthread -Wextra -Wno the tall -pedantic -DBOOST_ALL_NO_LIB = 1 -DBOOST_CHRONO_STATIC_LINK = 1 -DBOOST_FILESYSTEM_VERSION = 3 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK = 1 -DBOOST_THREAD_BUILD_LIB = 1 -DBOOST_THREAD_POSIX - DNDEBUG-I "." -c -o "bin.v2 / libs / thread / build / gcc- and roid4.4.3 / release / link-static / runtime-link-static / threading-multi / pthread / thread.o" "libs / thread / src / Pthread / thread.cpp "... unsuccessful gcc.compile.c ++ bin.v2 / libs / thread / build / gcc- and roid4.4.3 / release / link-static / runtime-link-static / threading-multi / pthread / Thread .o ... I found this error I did not understand ...
. / Boost / thread / pthread / thread_data.hpp: 42: Error: 'PAGE_SIZE' was not declared in this radius it states that PAGE_SIZE was not declared, but I It does not know any meaning. And when I tried to see that particular place in that code I did not find PAGE_SIZE .
In this way the compilation errors are usually sorted by looking at the preprocessed output already - Try changing c with -E and changing foo.o to foo.pp (or something else) ) And review the file for foo.pp errors (search for set_stack_size ). This is the relevant code:
zero set_stack_size (std :: size_t size) BOOST_NOEXCEPT {if (size == 0) return; Std :: size_t page_size = getpagesize (); #ifdef PTHREAD_STACK_MIN if (size & lt; PTHREAD_STACK_MIN) size = PTHREAD_STACK_MIN; #endif Size = ((size + page_size-1) / page_size) * Page_size; getpagesize () spreads to some contexts, which is the reference PAGE_SIZE . I'm pretty sure that sysconf is the right way to get the page size these days, but the promoter may have a good reason to use getpagesize () . Regardless of this, you can dodge this specific error with the -DPAGE_SIZE = 2048 compiler argument, or whatever your target's page size is. Patches the source to either use, or use sysconf (_SC_PAGESIZE) instead.
Comments
Post a Comment