【caffe】win7+VS2013+Boost库配置

来源:互联网 发布:神武3手游狮驼数据 编辑:程序博客网 时间:2024/06/01 22:13

一.Boost编译预处理

boost官网下载:Boost 1.63.0 

1.编译boost库时,进入目录运行bootstrap.bat,出现错误:



如下:

Building Boost.Build engine      Failed to build Boost.Build engine.  Please consult bootstrap.log for furter diagnostics.      You can try to obtain a prebuilt binary from         http://sf.net/project/showfiles.php?group_id=7586&package_id=72941      Also, you can file an issue at http://svn.boost.org  Please attach bootstrap.log in that case.

2.method:在环境变量中的Path对应的项添加:C:\Windows\System32,重启电脑,问题解决。

二.VS2013环境配置

1.测试程序:

#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;}
2.配置
(1)右键 选择 ->属性页--->C/C++,在 附加包含目录添加或编辑Boost的文件路径

(2)在 链接器 选项卡中,找到附加库目录,添加Boost的libs的目录:

(3)测试成功:


0 0
原创粉丝点击