微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Vxworks7:Boost V1.75 标志:BOOST_THREAD_USES_GETPAGESIZE

如何解决Vxworks7:Boost V1.75 标志:BOOST_THREAD_USES_GETPAGESIZE

我尝试为 Vxworks7 (SR0540) 构建 boost 库:

Wrenv.exe -p vxworks-7
b2 -j16 install --prefix=buildresult/usr/root --libdir=buildresult/lib --includedir=buildresult/header variant=release link=static toolset=gcc cross-compile=vxworks threading=multi -d2 --with-atomic --with-chrono --with-container --with-date_time --with-exception --with-filesystem --with-json --with-log --with-math --with-regex --with-system | tee buildBoost.log

boost 构建过程在不同的地方产生以下错误

    In file included from ./boost/thread/thread_only.hpp:17,from libs\thread\src\pthread\thread.cpp:11:
./boost/thread/pthread/thread_data.hpp: In member function 'void boost::thread_attributes::set_stack_size(std::size_t)':
./boost/thread/pthread/thread_data.hpp:58:37: error: '::sysconf' has not been declared
           std::size_t page_size = ::sysconf( _SC_PAGESIZE);
                                     ^~~~~~~
./boost/thread/pthread/thread_data.hpp:58:37: note: suggested alternative: 'sscanf'
           std::size_t page_size = ::sysconf( _SC_PAGESIZE);
                                     ^~~~~~~
                                     sscanf
./boost/thread/pthread/thread_data.hpp:58:46: error: '_SC_PAGESIZE' was not declared in this scope
           std::size_t page_size = ::sysconf( _SC_PAGESIZE);
                                              ^~~~~~~~~~~~
...Failed gcc.compile.c++ bin.v2\libs\thread\build\gcc-8.1.0\release\address-model-32\cross-compile-vxworks\link-static\visibility-hidden\pthread\thread.o...

在源代码里面是相关的几行: https://www.boost.org/doc/libs/1_75_0/boost/thread/pthread/thread_data.hpp

#ifdef BOOST_THREAD_USES_GETPAGESIZE
          std::size_t page_size = getpagesize();
#else
          std::size_t page_size = ::sysconf( _SC_PAGESIZE);
#endif

所以问题是:是否可以通过 BOOST_THREAD_USES_GETPAGESIZE 标志来解决错误,或者是否有其他解决方案?

提前谢谢

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。