『boost』安装及使用的记录
来源:互联网 发布:.net编程用什么软件 编辑:程序博客网 时间:2024/06/05 12:07
原文链接:boost安装及使用的记录
其他参考:windows下boost怎样安装与使用说明?
http://www.cnblogs.com/finallyliuyu/archive/2010/08/23/1806811.html
http://www.boostpro.com/download/
安装
ubuntu:
1) 在新立得(Synaptic)里搜索boost安装即可。
2) 编译时候需要如果使用boost的lib文件,则需要用-l指明。
windows:
1) 事先下载 icu,假设解压的路径是 c:\icu。
2) 在 boost主页下载安装包,解压,假设解压的路径是 c:\boost\。
3) 编译或下载bjam。
4) 安装方式有两种,一种是install,一种是stage。stage避免把文件拷贝一遍,推荐该方法。
A
gcc
bjam stage --toolset=gcc -sICU_PATH="c:\icu" --stagedir="c:\boost\bin\gcc" release --without-graph_parallel
--without-*** bjam stage --toolset=gcc -sICU_PATH="c:\icu" --stagedir="c:\boost\bin\gcc" debug --without-graph_parallel
--without-*** (--without-*** 就是不要编译的库,比如--without-python --without-wave --without-mpi ,除此之外都编译)
或者
bjam stage --toolset=gcc -sICU_PATH="c:\icu" --stagedir="c:\boost\bin\gcc" release --without-graph_parallel --with-***
bjam stage --toolset=gcc -sICU_PATH="c:\icu" --stagedir="c:\boost\bin\gcc" debug --without-graph_parallel --with-***
(--with-***就是仅编译的库,例如 --with-regex
--with-filesystem) B msvc (打开Visual Studio 命令)
bjam stage --toolset=msvc -sICU_PATH="c:\icu" --stagedir="c:\boost\bin\vc10" release --without-***
bjam stage --toolset=msvc -sICU_PATH="c:\icu" --stagedir="c:\boost\bin\vc10" debug --without-***
或者
bjam stage --toolset=msvc -sICU_PATH="c:\icu" --stagedir="c:\boost\bin\vc10" release --with-***
bjam stage --toolset=msvc -sICU_PATH="c:\icu" --stagedir="c:\boost\bin\vc10" debug --with-***
5) 在IDE中添加boost的库信息
vs 2010 IDE (每个项目都需要单独添加,很麻烦)
1.Include Path c:\boost
(root dir)
2.Library Path c:\boost\bin\vc10\lib(lib dir)
3.Source Path c:\boost\boost(include-file dir) CodeBlocks
1.Linker
Setting -> Compiler and debuger -> Global compiler setting -> Linker setting ->
Add (c:\boost \bin\gcc\*.a) (all the lib files)
2.Search
Setting -> Compiler and debuger -> Global compiler setting -> Search directories -> Compiler ->
Add (c:\boost) (root dir)
6) 如果是命令行编译,可以改如下的bat文件
A gcc
set boost_root=c:\boost
set boost_lib=%boost_root%\bin\gcc\lib
set use_boost=-I %boost_root% -L %boost_lib%
set filesystem=-lboost_filesystem-mgw44-mt-d-1_46_1 -lboost_system-mgw44-mt-d-1_46_1
set regex=-lboost_regex-mgw44-mt-d-1_46_1:: example
:: g++ lex.cpp -o lex %use_boost%
:: g++ regex_1.cpp -o regex_1 %use_boost% %regex%
:: g++ traverse_dir.cpp -o traverse_dir_gcc_new %use_boost% %filesystem%
B
msvc
set boost_root=c:\boost
set boost_lib=%boost_root%\bin\vc10\lib
set use_boost=/EHsc /I %boost_root% /MD /link /libpath:%boost_lib%:: example
:: cl regex_1.cpp /Feregex_1_vc.exe %use_boost%
:: del regex_1.obj
当然,也可以写一个makefile。
boost里面的库简单介绍
- 『boost』安装及使用的记录
- linux下安装boost及boost::thread的使用
- boost循序渐进1: boost的安装及注意使用注意事项
- boost的安装使用
- vs2005下安装boost::regex 及简单的使用(转)
- 【C/C++】boost regex正则表达式的安装及使用
- linux下boost库的安装及使用
- Mac平台下boost安装及使用
- Mac平台下boost安装及使用
- Boost编译安装记录
- boost的安装和使用
- Ubuntu安装及使用记录
- MySql安装及使用记录
- python opencv 安装记录及使用记录
- vs2013的boost安装及配置
- boost的编译安装 以及boost regex的使用
- boost入门及安装
- C++ Boost库的编译及使用
- 稀疏表示 字典学习 SMALLbox SPARCO toolbox
- DirectFB 源码解读之字体-2
- IOS全局变量
- jsp数据库连接大全(代码分色+注释)版本
- Tomcat发布项目时,浏览器地址栏图标的问题
- 『boost』安装及使用的记录
- /etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc
- 从 Objective-C 里的 Alloc 和 AllocWithZone 谈起
- UML中几种类间关系:继承、实现、依赖、关联、聚合、组合的联系与区别
- HTML5开辟无需下载的移动应用时代
- javascript浮点数的计算
- 重写Ckeditor的Save按钮保存方法
- Android之CursorAdapter示例
- JIRA