2013-09-05 163 views
3

我想为Android构建提升1.54。我能够做到这一点date_time,文件系统,正则表达式,program_options,信号,系统和线程库的提升。但是如果我在其中添加boost日志库,那么构建失败的原因是'更新8个目标失败'。提升为Android建设提升日志

予所附的以下行到我的用户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 
     ; 

我也改变库/文件系统/ SRC/operations.cpp文件以编译线程库。你可以找到必要的变化here

我的生成命令是如下

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 

正如我已经告诉过,如果我没有在构建键入命令--with-log它编译。

这里有几个从输出线,

gcc.compile.c++ bin.v2\libs\log\build\gcc-android\release\build-no\link-static\log-api-unix\target-os-linux\threadapi-pthread\threading-multi\attribute_name.o 
In file included from libs\log\src\attribute_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 

它包括许多行像这些,但这些都是第一个错误,它给了。

有人可以看到我做错了什么,或者我应该改变什么?

谢谢

+3

正如您已经发现的那样,此类型直到API 9(https://code.google.com/p/android/issues/detail?id = 24228) –

回答

3

只是改变平台到android-9解决了这个问题。 之后,它给出了另一个已经在here中修复的错误