VS2013编译boost1.55库
1. 官网下载最新的Boost库,我的是1.55
2.
在使用vs2013编译boost-1.55.0之前,先要给boost做下修改:
boost_1_55_0\boost\intrusive\detail\has_member_function_callable_with.hpp line:222
template<class U>
static BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)
<U> Test(BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)<U>*);
替换成以下内容:
#ifdef BOOST_MSVC
template<class U>
static decltype(boost::move_detail::declval<Fun>().BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME()
, boost_intrusive_has_member_function_callable_with::yes_type())
Test(Fun*);
#else
template<class U>
static BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)
<U> Test(BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)<U>*);
#endif
3. 编译
64位编译:
- 从开始菜单启动Visual Studio 2013的vs2013 x64兼容工具命令行,然后转到boost根文件夹,运行bootstrap.bat生成x64版的bjam.exe。
- 运行命令:
bjam.exe stage --toolset=msvc-12.0 --without-graph --without-graph_parallel --without-math --without-mpi --without-serialization
--without-wave --without-test --without-program_options --without-serialization --without-signals
--stagedir=".\bin\vc12_x64" link=static runtime-link=shared threading=multi debug release address-model=64
4. 添加boostest工程的包含目录和库目录

添加库目录

5. 测试程序
新建一个空的Win32 Console Application项目
#include <iostream>
#include <boost/lexical_cast.hpp>
#include <boost/timer.hpp> int main()
{
int a = boost::lexical_cast<int>("");
double b = boost::lexical_cast<double>("123.0123456789");
std::string s0 = boost::lexical_cast<std::string>(a);
std::string s1 = boost::lexical_cast<std::string>(b);
std::cout << "number is: " << a << " " << b << std::endl;
std::cout << "string is: " << s0 << " " << s1 << std::endl; int c = ;
try
{
c = boost::lexical_cast<int>("abcd");
}
catch (boost::bad_lexical_cast & e)
{
std::cout << e.what() << std::endl;
return -;
} return ;
}
6. 运行结果:
number is: 123 123.012
string is: 123 123.0123456789
bad lexical cast: source type value could not be interpreted as target
Press any key to continue . . .
VS2013编译boost1.55库的更多相关文章
- vs2013编译boost1.55.0 32/64位
在使用vs2013编译boost-1.55.0之前,先要给boost做下修改: boost_1_55_0\boost\intrusive\detail\has_member_function_call ...
- (原)vs2013编译boost1.60库
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5394236.html 参考网址: http://www.cnblogs.com/chuncn/arch ...
- windows8中visual studio 2010 编译boost1.57库
参考: http://blog.csdn.net/a06062125/article/details/7773976 http://www.cppfans.org/1317.html http://w ...
- (原)vs2013编译成静态库
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5477664.html 1. 在“属性”-“配置属性”-“常规”-“配置类型”里面设置“静态库(.lib ...
- Vs2012(Vs2013) 编译 64位 Qt (动态库), 并使用自编译Qt建立工程(悲催经历)。(含遗留问题)
仅供参考. 体会:我个人此次编译不该使用Vs2013编译Qt. 使用以下程序: Qt : qt-opensource-windows-x86-msvc2012_64_opengl-5.2.1.exe ...
- (原)ubuntu16中编译boost1.61.0库
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5797940.html 参考网址: http://www.boost.org/doc/libs/1_61 ...
- VS2015编译boost1.62
VS2015编译boost1.62 Boost库是一个可移植.提供源代码的C++库,作为标准库的后备,是C++标准化进程的开发引擎之一. Boost库由C++标准委员会库工作组成员发起,其中有些内容有 ...
- mongo-c-driver使用VS2013编译
1.下载mongo-c-driver源码文件 使用github来下载. git clone https://github.com/mongodb/mongo-c-driver.git 下载完之后,进入 ...
- net-snmp源码VS2013编译添加加密支持(OpenSSL)
net-snmp源码VS2013编译添加加密支持(OpenSSL) snmp v3 协议使用了基于用户的安全模型,具有认证和加密两个模块. 认证使用的算法是一般的消息摘要算法,例如MD5/SHA等.这 ...
随机推荐
- 【Maven】maven的常用命令以及搭建maven私人仓库
一.maven环境搭建 1. 二.maven常用命令 1.创建一个新的项目: mvn archetype:create -DgroupId=com.puyangsky.test -DartifactI ...
- 哈尔滨理工大学第七届程序设计竞赛(G.Great Atm)
Description An old story said the evil dragon wasn't evil at all, only bewitched, and now that the r ...
- Oracle 索引扫描的五种类型
之前在讨论CBO和RBO的时候提到了索引扫描的几种类型. Oracle Optimizer CBO RBO http://blog.csdn.net/tianlesoftware/archive/20 ...
- 【欧拉回路】【Fleury算法】CDOJ1642 老当益壮, 宁移白首之心?
题意: 构造一个01串,使得满足以下条件: 1. 环状(即首尾相连) 2. 每一位取值为0或1 3. 长度是2^n 4. 对于每个(2^n个)位置,从其开始沿逆时针方向的连续的n位01串(包括自己) ...
- 【(博弈)dfs序+树状数组】BZOJ2819-Nim
[题目大意] 普通的Nim游戏为:两个人进行游戏,N堆石子,每回合可以取其中某一堆的任意多个,可以取完,但不可以不取.谁不能取谁输.这个游戏是有必胜策略的.现在对每一堆编号1,2,3,4,...n,在 ...
- bzoj 1689: [Usaco2005 Open] Muddy roads 泥泞的路
1689: [Usaco2005 Open] Muddy roads 泥泞的路 Description Farmer John has a problem: the dirt road from hi ...
- 20162318 2016-2017-2《Java程序设计》课堂实践项目
20162318 2016-2017-2<Java程序设计>课堂实践项目 String类的使用 在String类中有一种split的方法.它可以把字符串分割为好几个小的字符串. 实践内容: ...
- Erlang学习记录(三)——表达式大集合
Erlang中的表达式必须以.结束才会去执行.如果不加.你在编译环境下按多少次Enter,表达式都不会执行,表达式之间可以用,分隔,以.结尾后所有的表达式都会执行,但是只有最后一个以.结尾的表达式会在 ...
- iptables最常用的规则示例
iptables v1.4.21 iptables基础 规则(rules)其实就是网络管理员预定义的条件,规则一般的定义为“如果数据包头符合这样的条件,就这样处理这个数据包”.规则存储在内核空间的信息 ...
- virtualbox4.2.18 ubuntu12.04 The system is running in low-graphics mode
参考1:http://askubuntu.com/questions/225090/the-system-is-running-in-low-graphics-mode-error-in-virtua ...