编辑tools/build/src/tools/gcc.jam

rule setup-threading ( targets * : sources * : properties * )
{
local threading = [ feature.get-values threading : $(properties) ] ;
if $(threading) = multi
{
local target = [ feature.get-values target-os : $(properties) ] ;
local option ;
local libs ;

switch $(target)
{
case android : # No threading options, everything is in already.
case windows : option = -mthreads ;
case cygwin : option = -mthreads ;
case solaris : option = -pthreads ; libs = rt ;
case beos : # No threading options.
case haiku : option = ;
case *bsd : option = -pthread ; # There is no -lrt on BSD.
case sgi : # gcc on IRIX does not support multi-threading.
case darwin : # No threading options.
case * : option = -pthread ; #libs = rt ;
}

将libs = rt这行注释掉

------------------------------------------------------------------

Indeed all occurrencies of -lrt with sed doesn't seem to have any impact on the problem.
What worked for me (in boost 1.53.0 though) is the following:

Edit tools/build/v2/tools/gcc.jam

Comment libs = rt ; in this code section (By the way, it could be that you do not have the -pthread option line):

case * :
{
option = -pthread ;
libs = rt ; <--Comment this line
}

Note: As initial/brute force solution, I would take the failed commands and manually run them removing -lrt from them.

question:

So I am trying to build boost 1.55 for android, but I am getting linking errors for Boost.System and Boost.Atomic, that say "error: cannot find -lrt". Of course, android doesn't have librt because its built into the C runtime. So, I am trying to get boost so it won't link to librt. I tried just deleting every "-lrt" in the source code:

find . -type f | xargs -n1 -P 8 sed -i "s/-lrt//g"

But I still get the same error. How do I make boost not link against librt for android?

answer:

Indeed all occurrencies of -lrt with sed doesn't seem to have any impact on the problem.
What worked for me (in boost 1.53.0 though) is the following:

Edit tools/build/v2/tools/gcc.jam

Comment libs = rt ; in this code section (By the way, it could be that you do not have the -pthread option line):

case * :
{
option = -pthread ;
libs = rt ; <--Comment this line
}

Note: As initial/brute force solution, I would take the failed commands and manually run them removing -lrt from them.

Building Boost for Android with error “cannot find -lrt”的更多相关文章

  1. Unity出现 error building player exception android (invocation failed)

    今天在编译Android的时候出现这个错误 error building player exception android (invocation failed) 百度谷歌之后,看到xuanyuson ...

  2. android studio Error:java.lang.OutOfMemoryError: GC overhead limit exceeded

    android studio Error:java.lang.OutOfMemoryError: GC overhead limit exceeded 在app下的build.gradle中找到and ...

  3. android stack error message is Fail to start the plugin

    E: 08-26 16:34:11.934: E/AliSDK(32236): 错误编码 = 1002208-26 16:34:11.934: E/AliSDK(32236): 错误消息 = SDK  ...

  4. android studio error configuration with name default not found

    Android Studio报错: android studio error configuration with name default not found 在进行sync的时候,提示Error: ...

  5. [2015-06-10 20:53:50 - Android SDK] Error when loading the SDK:

    1.错误描述 [2015-06-10 20:53:50 - Android SDK] Error when loading the SDK: Error: Error parsing D:\Andro ...

  6. building 'twisted.test.raiser' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    Error msg: building 'twisted.test.raiser' extension error: Microsoft Visual C++ 14.0 is required. Ge ...

  7. 解决 Boost安装:fatal error: bzlib.h: No such file or directory 问题

    参考: How to install all the boost development libraries? 解决 Boost安装:fatal error: bzlib.h: No such fil ...

  8. 安装scrapy 出错 building 'twisted.test.raiser' extension error: Microsoft Visual C++ 14.0 is required.

    安装Scrapy出现错误: building 'twisted.test.raiser' extension error: Microsoft Visual C++ 14.0 is required. ...

  9. Boost test vs2013 fatal error C1001

    Boost test vs2013 fatal error C1001 Boost test库提供了一个用于单元测试的基于命令行界面的测试套件UTF:Unit Test Framework,具有单元测 ...

随机推荐

  1. js中找string中重复项最多的字符个数

    // split():字符串中的方法,把字符串转成数组. // sort():数组中的排序方法,按照ACALL码进行排序. // join():数组中的方法,把数组转换为字符串 function de ...

  2. Mac或者linux下登陆到linux上的SFTP

    登陆 sftp  -i  密钥路径  用户@ip ➜  ~ sftp -i Desktop/aliyun.pem root@39.106.30.1 Connected to 39.106.30.1 上 ...

  3. 微信小程序使用阿里图标

    微信小程序不支持外联阿里图标,必须下载放入小程序的本地文件中. 步骤一:下载项目图标 步骤二:转换iconfont.ttf文件(小程序的wxss文件的font-face的url不接受http地址作为参 ...

  4. NSNull, Nil, nil, NULL区别(OC)

    参考:http://nshipster.com/nil/ 直接给个表吧 Symbol Value Meaning NULL (void *)0 literal null value for C poi ...

  5. Deep Voice

    https://arxiv.org/abs/1702.07825 听起来和真人声非常接近了.

  6. 75道阿里Java面试题,你能答上几道?

    整理了下阿里近几年的java面试题目,大家参考下吧,希望对大家有帮助,可以帮大家查漏补缺. 答对以下这些面试题,可以淘汰掉 80 % 的求职竞争者. 1.hashcode相等两个类一定相等吗?equa ...

  7. 哪些因素影响ABBYY FineReader 12的识别质量

    任何一款OCR文字识别软件都无法确保100%识别准确,更何况诸多因素的存在,都有可能直接或间接影响识别质量.在使用ABBYY FineReader 12识别或者转换文档的时候也存在同样的状况,今天来给 ...

  8. opencv获取IP摄像头(IP-camera)实时视频流

    之前这篇文章讲了如何通过网络摄像头(web camera)获取实时视频流,但是这种方法的缺陷就是摄像头和主机必须连在一起,那这种在室外部署的时候就会非常麻烦并且不安全,所以后来找了下用海康威视或者大华 ...

  9. android5.1移植记录

    应用能够配置Android系统的各种设置,这些设置的默认值都是由frameworks中的SettingsProvider从数据库中读取的frameworks/base/packages/Setting ...

  10. ios开发之--令UITableView滚动到指定位置

    这个应用场景还是挺多的,代码如下: //获取到需要跳转位置的行数 NSIndexPath *scrollIndexPath = [NSIndexPath indexPathForRow: inSect ...