windows下编译Android版本的boost库文件
1.起因:
手上有一个用到了boost的asio库和thread库的工程要编译到手机上(Android版本和ios版本),本文只介绍如何编译到Android版本,ios版本之后再介绍,也许就不介绍了(注:因为mac下官方有教程如何编译)
2.准备工作
2.1 下载boost库,我这里用到的是1.58.0
2.2 下载NDK(注:Google官方地址,需要翻墙),根据情况自己选择下载版本,我这里用的是android-ndk-r10d-windows-x86_64.exe
2.3 安装visual studio 2012或者2013, 我用的是vs2013
3.开始编译
3.1 解压boost压缩文件
3.2 在命令行下进入上步文件夹下,然后运行bootstrap.bat,这里会生成project-config.jam文件
3.3 修改project-config.jam文件,修改内容如下
import option ;
androidNDKRoot = E:/android/android-ndk-r10d ; # put the relevant path
using gcc : android
:
$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++
:
<archiver>$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-ar
<compileflags>-fexceptions
<compileflags>-frtti
<compileflags>-fpic
<compileflags>-ffunction-sections
<compileflags>-funwind-tables
<compileflags>-D__ARM_ARCH_5__
<compileflags>-D__ARM_ARCH_5T__
<compileflags>-D__ARM_ARCH_5E__
<compileflags>-D__ARM_ARCH_5TE__
<compileflags>-Wno-psabi
<compileflags>-march=armv5te
<compileflags>-mtune=xscale
<compileflags>-msoft-float
<compileflags>-mthumb
<compileflags>-Os
<compileflags>-std=c++11
<compileflags>-fomit-frame-pointer
<compileflags>-fno-strict-aliasing
<compileflags>-finline-limit=64
<compileflags>-I$(androidNDKRoot)/platforms/android-9/arch-arm/usr/include
<compileflags>-Wa,--noexecstack
<compileflags>-DANDROID
<compileflags>-D__ANDROID__
<compileflags>-DNDEBUG
<compileflags>-O2
<compileflags>-g
<compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/include
<compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include
# @Moss - Above are the 'oficial' android flags
<architecture>arm
<compileflags>-fvisibility=hidden
<compileflags>-fvisibility-inlines-hidden
<compileflags>-fdata-sections
<cxxflags>-D__arm__
<cxxflags>-D_REENTRANT
<cxxflags>-D_GLIBCXX__PTHREADS
;
option.set keep-going : false ; 
3.4 创建批处理命令,内容如下
b2 --without-context --without-coroutine --without-program_options --without-container --without-iostreams --without-locale --without-signals --without-wave --without-timer --without-mpi --without-log --without-test --without-atomic --without-chrono --without-filesystem --without-graph --without-graph_parallel --without-math --without-python --without-random link=static threading=multi threadapi=pthread target-os=linux toolset=gcc-android
b2 参数说明
- --without 表示不编译这个项目
 - --with 表示要编译这个项目
 
3.5 运行3.4创建的批处理,应该就能生成静态库文件,可以在项目中使用了
后记:如果还是有问题,详细查看我之前的步骤,欢迎大家来和我讨论
windows下编译Android版本的boost库文件的更多相关文章
- ubuntu下编译android jni到so库的mk文件配置
		
项目根目录下的Android.mk文件 LOCAL_PATH:= $(call my-dir)include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional L ...
 - 在Windows下编译Emacs
		
在Windows下编译Emacs Windows下编译好的Emacs主要有两个版本,一个来自http://nqmacs.sourceforge.net/,另一个来自http://www.crasseu ...
 - windows下编译和安装boost库
		
boost是一个功能强大.构造精巧.跨平台.开源并且完全免费的C++程序库. 获取方式 boost提供源码形式的安装包,可以从boost官方网站下载,目前最新版本是1.59.0. 本机上正好有boos ...
 - 如何在WINDOWS下编译BOOST C++库 .
		
如何在WINDOWS下编译BOOST C++库 cheungmine 2008-6-25 写出来,怕自己以后忘记了,也为初学者参考.使用VC8.0和boost1.35.0. 1)下载boost ...
 - osg for android学习之一:windows下编译(亲测通过)【转】
		
1. 首先需要一个OSG for android的环境 (1)NDK 现在Eclipse 对NDK已经相当友好了,已经不需要另外cygwin的参与,具体可以参考 Android NDK开发篇(一):新 ...
 - 编译 Android 版本的 Opus 音频编解码库的方法
		
Opus 音频编解码库是 Speex 音频编解码库的下一代版本,从编解码性能以及质量上来讲都有了长足的进步.Opus 的编译非常简单,但是官方并未给出详细的 Android 版本编译指南,查找了大量资 ...
 - linux下编译qt5.6.0静态库——configure配置
		
linux下编译qt5.6.0静态库 linux下编译qt5.6.0静态库 configure生成makefile 安装选项 Configure选项 第三方库: 附加选项: QNX/Blackberr ...
 - linux下编译qt5.6.0静态库——configure配置(超详细,有每一个模块的说明)(乌合之众)
		
linux下编译qt5.6.0静态库 linux下编译qt5.6.0静态库 configure生成makefile 安装选项 Configure选项 第三方库: 附加选项: QNX/Blackberr ...
 - 一步步实现windows版ijkplayer系列文章之四——windows下编译ijkplyer版ffmpeg
		
一步步实现windows版ijkplayer系列文章之一--Windows10平台编译ffmpeg 4.0.2,生成ffplay 一步步实现windows版ijkplayer系列文章之二--Ijkpl ...
 
随机推荐
- Web程序和应用程序服务器[转]
			
转自:http://hi.baidu.com/lclkathy/blog/item/dae3be36763a47370b55a970.html 一 常见的WEB服务器和应用服务器 在UNIX和LINU ...
 - Linux入门(五)linux服务器文件远程管理
			
1 使用filezila远程管理linux服务器文件 filezila下载地址:https://filezilla-project.org/ filezila默认只能登录普通用户,如果想要root用 ...
 - 一、什么是WCF
			
注:本文为学习摘抄,原地址:http://www.cnblogs.com/iamlilinfeng/archive/2012/09/25/2700049.html 一.概述 Windows Commu ...
 - 驱动力—— 通信引擎(上)—— ESFramework 4.0 进阶(03)
			
在ESFramework 4.0 进阶(02)-- 核心:消息处理的骨架流程一文中我们详细介绍了ESFramework中消息处理的骨架流程,并且我们已经知道,ESFramework中的所有通信引擎使用 ...
 - 简单学习JavaScript面向对象编程
			
JavaScript是一种弱类型语言.有一种原型机制. 1.创建一个空对象:var bill = {}; 给这个对象添加属性和方法: bill.name = "Bill E Goat&quo ...
 - 3. 编写Java应用程序,定义Animal类,此类中有动物的属性:名称 name,腿的数量legs,统计动物的数量 count;方法:设置动物腿数量的方法 void setLegs(),获得腿数量的方法 getLegs(),设置动物名称的方法 setKind(),获得动物名称的方法 getKind(),获得动物数量的方法 getCount()。定义Fish类,是Animal类的子类,统计鱼的数量
			
//Animal 类 package d922B; public class Animal { private String kind; private int legs,count; public ...
 - Nginx 安装(CentOS )
			
一.安装编译工具及库文件 yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel 二.首先要安装 PCRE ...
 - 使用node.js创建第一个应用
			
node.js应用组成部分 1.引入require模块:我们可以使用require指令来载入Node.js模块. 2.创建服务器:服务器可以监听客户端的请求,类似于Apache,Nninx等HTTP服 ...
 - redis----查询keys(模糊匹配)
			
keys * 返回所有的key keys h?llo 类似数据库的匹配使用 keys h*lleo 类似数据库的匹配使用 keys h[ae]llo 只能是a或e的匹配 一次设置多个keys ms ...
 - 1.5后台修改添加TDK
			
manager\includes\languages\english.php //注意 是后台的语言包define('BOX_CONFIGURATION_Lin_STORE', 'TDKcss_set ...