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位编译:

  1. 从开始菜单启动Visual Studio 2013的vs2013 x64兼容工具命令行,然后转到boost根文件夹,运行bootstrap.bat生成x64版的bjam.exe。
  2. 运行命令:

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库的更多相关文章

  1. vs2013编译boost1.55.0 32/64位

    在使用vs2013编译boost-1.55.0之前,先要给boost做下修改: boost_1_55_0\boost\intrusive\detail\has_member_function_call ...

  2. (原)vs2013编译boost1.60库

    转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5394236.html 参考网址: http://www.cnblogs.com/chuncn/arch ...

  3. windows8中visual studio 2010 编译boost1.57库

    参考: http://blog.csdn.net/a06062125/article/details/7773976 http://www.cppfans.org/1317.html http://w ...

  4. (原)vs2013编译成静态库

    转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5477664.html 1. 在“属性”-“配置属性”-“常规”-“配置类型”里面设置“静态库(.lib ...

  5. Vs2012(Vs2013) 编译 64位 Qt (动态库), 并使用自编译Qt建立工程(悲催经历)。(含遗留问题)

    仅供参考. 体会:我个人此次编译不该使用Vs2013编译Qt. 使用以下程序: Qt : qt-opensource-windows-x86-msvc2012_64_opengl-5.2.1.exe ...

  6. (原)ubuntu16中编译boost1.61.0库

    转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5797940.html 参考网址: http://www.boost.org/doc/libs/1_61 ...

  7. VS2015编译boost1.62

    VS2015编译boost1.62 Boost库是一个可移植.提供源代码的C++库,作为标准库的后备,是C++标准化进程的开发引擎之一. Boost库由C++标准委员会库工作组成员发起,其中有些内容有 ...

  8. mongo-c-driver使用VS2013编译

    1.下载mongo-c-driver源码文件 使用github来下载. git clone https://github.com/mongodb/mongo-c-driver.git 下载完之后,进入 ...

  9. net-snmp源码VS2013编译添加加密支持(OpenSSL)

    net-snmp源码VS2013编译添加加密支持(OpenSSL) snmp v3 协议使用了基于用户的安全模型,具有认证和加密两个模块. 认证使用的算法是一般的消息摘要算法,例如MD5/SHA等.这 ...

随机推荐

  1. ubuntu右上角红色三角警告

    问题:ubuntu右上角红色三角感叹号警告,显示更新信息已过期The update information is outdated. 解决方案: 首先在“系统设置(system settings)”- ...

  2. HDU 1016.Prime Ring Problem-素数环,相邻两数和为素数-DFS

    Prime Ring Problem Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Other ...

  3. 转:fortios 5.4后门植入

    提示: 1.经过实验,fortios 5.4 beta4也是可以的. 2.在实验时,选择先下载fortios 5.2(做了快照),再升级5.4,则虚拟机挂载需要选择FortiGate-VM-disk1 ...

  4. 【Kubernetes】在K8s中创建StatefulSet

    在K8s中创建StatefulSet 遇到的问题: 使用Deployment创建的Pod是无状态的,当挂在Volume之后,如果该Pod挂了,Replication Controller会再run一个 ...

  5. J2EE技术架构

    一.简介 J2EE(Java 2 Platform, Enterprise Edition)是一个为大企业主机级的计算类型而设计的Java平台.Sun微系统(与其工业伙伴一起,例如IBM)设计了J2E ...

  6. Spring的安全机制

    Spring Security:它提供全面的安全性解决方案,同时在Web请求和方法调用处理身份确认和授权,利用依赖注入和aop技术.主要名词: 1,安全拦截器:相当应用的一把锁,能够阻止对应用程序中保 ...

  7. 【BZOJ 4104】【THUSC 2015】解密运算

    http://www.lydsy.com/JudgeOnline/problem.php?id=4104 网上题解满天飞,我也懒得写了 #include<cstdio> #include& ...

  8. 【置换群】poj3270 Cow Sorting

    并不应该叫置换群……只是用到了置换而已,并没有群. 题解看这个吧,我就不写了:http://www.cnblogs.com/kuangbin/archive/2012/09/03/2669013.ht ...

  9. 20162303 实验一 Java开发环境的熟悉(Linux + Eclipse)

    北京电子科技学院(BESTI) 实 验 报 告 课程:程序设计与数据结构 班级: 1623 姓名: 石亚鑫 学号:20162303 成绩: 2分 指导教师:娄嘉鹏 王志强 实验日期:3月17日 实验密 ...

  10. Codeforces Gym 100269B Ballot Analyzing Device 模拟题

    Ballot Analyzing Device 题目连接: http://codeforces.com/gym/100269/attachments Description Election comm ...