编译,测试BOOST
来源:互联网 发布:数据库查询语句大全 编辑:程序博客网 时间:2024/05/29 10:27
在使用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
1、管理员权限cmd中运行:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"编译32位
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat"编译64位
2、命令行进入boost所在目录,运行bootstrap.bat(我的64位没有执行步骤一出错)
3、32位编译:
主意要把换行符去掉:把命令复制到记事本去掉换行符
- 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_x86" link=static
- runtime-link=shared threading=multi debug release
64位编译:
- 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
包含目录添加 D:\boost_1_55_0
库目录添加 D:\boost_1_55_0\stage\lib
具体如下图:
5、测试代码:
- #include <boost/lexical_cast.hpp>
- #include <iostream>
- using namespace std;
- int main()
- {
- using boost::lexical_cast;
- int a = lexical_cast<int>("123");
- double b = lexical_cast<double>("123.0123456789");
- string s0 = lexical_cast<string>(a);
- string s1 = lexical_cast<string>(b);
- cout << "number: " << a << " " << b << endl;
- cout << "string: " << s0 << " " << s1 << endl;
- int c = 0;
- try{
- c = lexical_cast<int>("abcd");
- }
- catch (boost::bad_lexical_cast& e){
- cout << e.what() << endl;
- }
- system("pause");
- return 0;
- }
0 0
- 编译,测试BOOST
- g++ boost库编译及测试
- VC8编译安装boost 1.39库及测试代码
- VC8编译安装boost 1.39库及测试代码(转载)
- C++ boost库无锁队列多线程并行测试与编译方法
- 在Windows下Boost库编译方法与测试
- VS2017中对BOOST的编译,及demo测试
- 编译BOOST
- boost编译
- boost编译
- 编译boost
- boost编译
- 编译BOOST
- 编译 boost
- Boost 编译
- 编译 boost
- boost编译
- 编译 boost
- 【总结】20151017重庆市NOIP模拟赛
- Qt 无边框、透明、可移动、的个性窗体案例详解
- opencv-cvWaitKey
- opencv3矩的计算-moments函数
- instanceof isInstance isAssignableFrom的区别
- 编译,测试BOOST
- stringstrream的使用及注意事项
- BOM
- kafka 优化
- opencv3矩的计算-在图像中的应用
- javascript
- Qt Style Sheet实践(一):按钮及关联菜单
- android传递数据bundle封装传递map对象
- 函数