Building Boost for Android with error “cannot find -lrt”
编辑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”的更多相关文章
- Unity出现 error building player exception android (invocation failed)
今天在编译Android的时候出现这个错误 error building player exception android (invocation failed) 百度谷歌之后,看到xuanyuson ...
- android studio Error:java.lang.OutOfMemoryError: GC overhead limit exceeded
android studio Error:java.lang.OutOfMemoryError: GC overhead limit exceeded 在app下的build.gradle中找到and ...
- 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 ...
- android studio error configuration with name default not found
Android Studio报错: android studio error configuration with name default not found 在进行sync的时候,提示Error: ...
- [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 ...
- 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 ...
- 解决 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 ...
- 安装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. ...
- Boost test vs2013 fatal error C1001
Boost test vs2013 fatal error C1001 Boost test库提供了一个用于单元测试的基于命令行界面的测试套件UTF:Unit Test Framework,具有单元测 ...
随机推荐
- linux rinetd 端口转发部署
linux下简单好用的工具rinetd,实现端口映射/转发/重定向 Rinetd是为在一个Unix和Linux操作系统中为重定向传输控制协议(TCP)连接的一个工具.Rinetd是单一过程的服务器,它 ...
- VS 调试 无法启动IIS Express Web 服务器(进程不存在)
拷贝VS2015项目 出现无法启动IIS Express Web 服务器 一.把你们拷贝刀本机的解决方案文件中的隐藏文件夹.vs删除掉 重新生产解决方案就可以启动iis express了.
- C# winform右击导入手机号码
private void 导入手机号ToolStripMenuItem_Click(object sender, EventArgs e) { using (OpenFileDialog Openfi ...
- C# 判断两张图片是否一致,极快速
#region 判断图片是否一致 /// <summary> /// 判断图片是否一致 /// </summary> /// <param name="img& ...
- HTML5重力感应小球冲撞动画实现教程
今天我们来分享一款很酷的HTML5重力感应动画教程,这款动画可以让你甩动页面中的小球,小球的大小都不同,并且鼠标点击空白区域时又可以生成一定数量的小球.当我们甩动小球时,各个小球之间就会发生互相碰撞的 ...
- Nginx配置优化解读
全局配置 Nginx的配置文件是nginx的安装目录的conf/nginx .conf,nginx.conf配置文件中,几个全局高级配置在模块部分之上. user www www; worker_p ...
- linux cfs调度器_模型实现
调度器真实模型的主要成员变量及与抽象模型的对应关系 I.cfs_rq结构体 a) struct sched_entity *curr 指向当前正在执行的可调度实体.调度器的调度单位 ...
- JS中 try...catch...finally (转)
JS的try..catch..finally var array = null; try { document.write(array[0]); } catch(err) { document.wri ...
- sql产生随机时间
--建立过程 CREATE PROCEDURE GetTime @BeginTime VARCHAR(5), @EndTime VARCHAR(5), @RandTime VA ...
- Unity3D学习笔记——Android远程真机调试(Unity Remote)
前言:当使用Unity开发移动端的游戏,特别是使用到手机的传感器,如重力感应等,调试的时候,很麻烦, 因为每次都需要编译成APK后安装到手机中测试,而Unity Remote便能很好的解决这个问题,U ...