参考资料
下载
Boost是C++准标准库,可在官网下载安装包,Windows下载boost_1_74_0.zip或boost_1_74_0.7z。也可以在开源网站SOURCEFORCE下载。尽量使用Visual Studio 最新版本。
安装
-
解压
-
搜索
x64 Native Tools Command Prompt for VS 2019
,以管理员身份运行。 -
切换目录到boost解压文件夹
e:
cd E:\software\boost_1_74_0
- 输入命令
bootstrap.bat
- 输入命令
b2.exe --toolset=msvc-14.2 architecture=x86 address-model=64 link=static --build-type=complete --with-system --with-thread --with-date_time --with-filesystem --with-serialization
- 编译完成
测试
-
VS 2019 新建项目
-
在源文件右键添加现有项,找到boost示例程序,路径为
E:\software\boost_1_74_0\libs\graph\example
-
在解决方案右键选择属性,在VC++目录中,编辑包含目录,添加
E:\software\boost_1_74_0
- 编辑库目录,添加
E:\software\boost_1_74_0\stage\lib
- 点击本地Windows调试器开始调试