VS2019配置boost1.74.0


 
这一段是我们以后配置完之后测试的代码
#include <iostream>
#include<boost/version.hpp>
#include<boost/config.hpp>
int main()
{
    using namespace std;
    cout << BOOST_VERSION << endl;
    cout << BOOST_LIB_VERSION << endl;
    cout << BOOST_PLATFORM << endl;
    cout << BOOST_COMPILER << endl;
    cout << BOOST_STDLIB << endl;
    getchar();
}

/*boost的命令配置
一:
    下载boost压缩文件,并解压到指定文件夹,这里使用d:\boost
二:
    管理员模式运行VS的配置控制台程序“Developer Command Prompt for VS 2019"
    运行以下命令:
        d:\
        cd d:\boost\boost_1_74_0
        bootstrap.bat
三:
    运行完以上命令后,会在目录下添加一个b2.exe
四:
    继续执行以下命令:
        .\b2.exe --toolset = msvc - 14.2 architecture = x86 address - model = 32 link = static --build - type = complete --with - system --with - thread --with - date_time --with - filesystem --with - serialization
        .\b2.exe --toolset = msvc - 14.2 architecture = x86 address - model = 32 link = static --build - type = complete --with - system --with - thread --with - random --with - filesystem --with - serialization
        .\b2.exe --toolset = msvc - 14.2 architecture = x86 address - model = 32 link = static --build - type = complete --with - system --with - thread --with - regex --with - filesystem --with - serialization
    时间可能会略久一点
五:
    配置VS项目
        1.右键项目,点击属性
            1)  C/C++ >> 常规 >>   附加包含目录 :d:\boost\boost_1_74_0
            2)  链接器 >> 常规 >> 附加库目录  : d:\boost\boost_1_74_0\stage

执行完以上操作就可以在项目中引用boost的头文件进行开发了
*/


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM