boost for android building boost log
boost for android building boost log
我正在尝试为android构建boost 1.54。我能够为boost的date_time、文件系统、regex、program_options、信号、系统和线程库做这件事。但如果我在其中添加boost日志库,构建会失败,就像"更新8个目标失败"一样。
我在我的user-config.jam 中添加了以下行
import os ;
androidNDKRoot = C:/android-ndk-r8e ; # put the relevant path
using gcc : android :
$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-g++ :
<compileflags>--sysroot=$(androidNDKRoot)/platforms/android-8/arch-arm
<compileflags>-mthumb
<compileflags>-Os
<compileflags>-fno-strict-aliasing
<compileflags>-O2
<compileflags>-DNDEBUG
<compileflags>-g
<compileflags>-lstdc++
<compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/include
<compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi/include
<compileflags>-D__GLIBC__
<compileflags>-D_GLIBCXX__PTHREADS
<compileflags>-D__arm__
<compileflags>-D_REENTRANT
<archiver>$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-ar
<ranlib>$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-ranlib
;
为了编译线程库,我还更改了libs/filesystem/src/operations.cpp文件。你可以在这里找到必要的零钱。
我的构建命令如下
set CXXFLAGS="-I%ANDROID_NDK%/platforms/android-8/arch-arm/usr/include -I%ANDROID_NDK%/sources/cxx-stl/gnu-libstdc++/4.4.3/include -I%ANDROID_NDK%/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include "
set TOOLSET=gcc-android
.b2 --toolset=%TOOLSET% --user-config=./user-config-android.jam cxxflags=%CXXFLAGS% threadapi=pthread --prefix=..boost_android_arm --builddir=./ target-os=linux --with-date_time --with-filesystem --with-regex --with-log define=BOOST_FILESYSTEM_VERSION=3 --with-program_options --with-signals --with-system --with-thread link=static runtime-link=shared threading=multi install
正如我之前所说的,如果我在build命令中不键入--with-log
,它就会编译。
以下是输出的几行,
gcc.compile.c++ bin.v2libslogbuildgcc-androidreleasebuild-nolink-staticlog-api-unixtarget-os-linuxthreadapi-pthreadthreading-multiattribute_name.o
In file included from libslogsrcattribute_name.cpp:32:0:
./boost/log/detail/light_rw_mutex.hpp:131:5: error: 'pthread_rwlock_t' does not name a type
./boost/log/detail/light_rw_mutex.hpp: In constructor 'boost::log::v2s_mt_posix::aux::light_rw_mutex::light_rw_mutex()':
./boost/log/detail/light_rw_mutex.hpp:136:30: error: 'm_Mutex' was not declared in this scope
./boost/log/detail/light_rw_mutex.hpp:136:43: error: 'pthread_rwlock_init' was not declared in this scope
./boost/log/detail/light_rw_mutex.hpp: In destructor 'boost::log::v2s_mt_posix::aux::light_rw_mutex::~light_rw_mutex()':
./boost/log/detail/light_rw_mutex.hpp:140:33: error: 'm_Mutex' was not declared in this scope
./boost/log/detail/light_rw_mutex.hpp:140:40: error: 'pthread_rwlock_destroy' was not declared in this scope
./boost/log/detail/light_rw_mutex.hpp: In member function 'void boost::log::v2s_mt_posix::aux::light_rw_mutex::lock_shared()':
./boost/log/detail/light_rw_mutex.hpp:144:32: error: 'm_Mutex' was not declared in this scope
./boost/log/detail/light_rw_mutex.hpp:144:39: error: 'pthread_rwlock_rdlock' was not declared in this scope
./boost/log/detail/light_rw_mutex.hpp: In member function 'void boost::log::v2s_mt_posix::aux::light_rw_mutex::unlock_shared()':
./boost/log/detail/light_rw_mutex.hpp:148:32: error: 'm_Mutex' was not declared in this scope
./boost/log/detail/light_rw_mutex.hpp:148:39: error: 'pthread_rwlock_unlock' was not declared in this scope
./boost/log/detail/light_rw_mutex.hpp: In member function 'void boost::log::v2s_mt_posix::aux::light_rw_mutex::lock()':
./boost/log/detail/light_rw_mutex.hpp:152:32: error: 'm_Mutex' was not declared in this scope
./boost/log/detail/light_rw_mutex.hpp:152:39: error: 'pthread_rwlock_wrlock' was not declared in this scope
./boost/log/detail/light_rw_mutex.hpp: In member function 'void boost::log::v2s_mt_posix::aux::light_rw_mutex::unlock()':
./boost/log/detail/light_rw_mutex.hpp:156:32: error: 'm_Mutex' was not declared in this scope
./boost/log/detail/light_rw_mutex.hpp:156:39: error: 'pthread_rwlock_unlock' was not declared in this scope
它包括许多类似的行,但这是它给出的第一个错误。
有人能看到我做错了什么吗?或者我应该改变什么?
感谢
只需将平台更改为android-9就解决了问题。在那之后,它产生了另一个错误,这个错误已经在这里修复了
相关文章:
- Boost::log只在debian中崩溃
- 我仍然收到此错误未定义的引用:boost::log::v2_mt_posix::trivial::logger::get
- Boost Log的琐碎记录器"lazy evaluation"是如何工作的?
- Boost Log:变量不是"boost::log::v2s_mt_posix::trivial"的
- boost.log-如何用附加和旋转配置text_file_backend
- Boost::log misbehaves (ubuntu 16.04, boost 1.58)
- boost.log错误与命名空间
- 如何使用boost.log的记录仪
- 使用Cygwin win32_api.hpp编译Boost Log中的错误
- Boost::log:基于级别的不同格式(HTML 格式)
- boost::log 输出到 Visual Studio 输出控制台 - 为格式添加额外的 LF/CR
- Boost Log-使用全局记录器时未定义的参考
- 使用init_from_source时,boost.log链接器错误
- 当我使用该功能时,"错误 ld 返回 1 个退出状态"boost::log::add_file_log()"
- 编译用于创建boost.log格式的代码时出错
- boost::log关闭日志文件并打开一个新文件
- 错误编译Boost.log
- 如何通过 boost::log 打印到具有不同属性的不同日志?
- Boost::log 使用静态工厂方法
- 为什么将链接限制与boost :: log