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等.这 ...
随机推荐
- 转:Google Project Zero挖洞经验整理
https://www.sec-un.org/google-project-zero%E6%8C%96%E6%B4%9E%E7%BB%8F%E9%AA%8C%E6%95%B4%E7%90%86/ 1. ...
- Shiro源码分析之Subject和SecurityManager
Subject 毫无疑问,Subject是Shiro最重要的一个概念. “Subject”只是一个安全术语,意味着应用程序用户的特定于安全性的“视图”.Shiro Subject实例代表单个应用程序用 ...
- getResourceAsStream 地址
getResourceAsStream ()返回的是inputstream getResource()返回:URL Class.getResource("") 返回的是当前C ...
- IN 运算符
在前面已经介绍了IN运算符的简单使用,使用IN运算符可以用来匹配一个固定集合中的某一项.比如下面的SQL语句检索在2001.2003和2005年出版的所有图书: SELECT * FROM T_Boo ...
- 最近升级mysql5.7出现下面问题,ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by
执行sql: SELECT * FROM `user_link` WHERE `group_id` IN ('78', '79') GROUP BY `link_id` 报错: SQLSTATE[42 ...
- 20162307 实验四 Android程序设计
实验四 <Android程序设计> 北京电子科技学院(BESTI) 实 验 报 告 课程:程序设计与数据结构 班级:1623 姓名:张韵琪 学号:20162307 指导教师:娄佳鹏老师.王 ...
- 使用redis时出现java.util.ArrayList cannot be cast to java.lang.Long
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Long at redis.clients. ...
- bootstrapTable定位行固定滚动条
写在前面: 当页面table列表数据有修改后,用户需要再次回到修改的行位置. 1.当修改行数据后,table刷新,行数据位置前后不发生改变 ,可使用下面这种方法: /*获取当前滚动条的位置*/ var ...
- gitHub 基础命令
设置开发人员信息 git config --global user.name "chen" git config --global user.email "xxxxx@q ...
- Unicode中的BOM
BOM简述 BOM是byte order mark的缩写,在UTF-16和UTF-32中需要使用BOM来区分字节的顺序,因为我们目前的CPU有两种系列,一种是大端模式,一种是小端模式(我们常用的电脑手 ...