Error LNK1104 cannot open file 'libboost_system-vc140-mt-gd-1_58.lib'
2015-11-22 17:25
435 查看
I had a similar problem when trying to use boost unit testing in Visual Studio 2015 (Community Edition):
fatal error LNK1104: libboost_unit_test_framework-vc140-mt-1_57
so I thought I'd share my solution.
You can create a boost unit testing project in of of two ways (and this solution works for both):
using the Boost Unit Test Adapter
or by creating a Win32 Console Application (steps here), and substituting the main function with a boost unit testing function (steps here).
Here are the steps I followed to get both projects to work:
First, download the desired boost version (for example, boost_1_57_0). You can either download boost with the correct binaries (compiled using msvc v140), or extract the binaries yourself by running the following commands from command line:
bootstrap.bat
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
bjam --clean
bjam -j4 --debug-symbols=on --build-type=complete toolset=msvc-14.0 threading=multi runtime-link=shared address-model=32
Where msvc-14.0 specifies that we require the Visual Studio 2015 version (VS 2015 = v14.0 = v140), and address-model=32 specifies that we require platform 32 (but the same can be done for 64 bit).
Once you have the binaries, go to Visual Studio, select the Boost Unit Testing project you have created. Go to Project properties > configuration (from the main menu) and make the following choices:
Set the "General > Platform Toolset" to Visual Studio 2015 (v140).
Include the path to the boost folder (e.g. C:\boost_1_57_0) and the path to the subfolder containing the binary files (e.g. C:\boost_1_57_0\stage\lib) in:
"C\C++ > Additional Include Directory"
and "Linker > Additional Library Directories".
参考链接:
http://stackoverflow.com/questions/13042561/fatal-error-lnk1104-cannot-open-file-libboost-system-vc110-mt-gd-1-51-lib
fatal error LNK1104: libboost_unit_test_framework-vc140-mt-1_57
so I thought I'd share my solution.
You can create a boost unit testing project in of of two ways (and this solution works for both):
using the Boost Unit Test Adapter
or by creating a Win32 Console Application (steps here), and substituting the main function with a boost unit testing function (steps here).
Here are the steps I followed to get both projects to work:
First, download the desired boost version (for example, boost_1_57_0). You can either download boost with the correct binaries (compiled using msvc v140), or extract the binaries yourself by running the following commands from command line:
bootstrap.bat
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
bjam --clean
bjam -j4 --debug-symbols=on --build-type=complete toolset=msvc-14.0 threading=multi runtime-link=shared address-model=32
Where msvc-14.0 specifies that we require the Visual Studio 2015 version (VS 2015 = v14.0 = v140), and address-model=32 specifies that we require platform 32 (but the same can be done for 64 bit).
Once you have the binaries, go to Visual Studio, select the Boost Unit Testing project you have created. Go to Project properties > configuration (from the main menu) and make the following choices:
Set the "General > Platform Toolset" to Visual Studio 2015 (v140).
Include the path to the boost folder (e.g. C:\boost_1_57_0) and the path to the subfolder containing the binary files (e.g. C:\boost_1_57_0\stage\lib) in:
"C\C++ > Additional Include Directory"
and "Linker > Additional Library Directories".
参考链接:
http://stackoverflow.com/questions/13042561/fatal-error-lnk1104-cannot-open-file-libboost-system-vc110-mt-gd-1-51-lib
相关文章推荐
- PowerShell GUI 之 添加列表选择框
- 如何在 CentOS 7.0 上配置 Ceph 存储
- Linux 内核配置和编译
- 在CentOS 6.6 64bit上安装Python 3.5.0
- iPhone上使用原生ViewController实现Popover
- 分布式监控系统Ganglia学习------(1)基本原理
- 解决一台机器同时运行多个Tomcat服务
- linux压缩及归档
- sqoop安装
- sqoop安装
- Linux系统启动流程
- 更改Apache默认网站根目录
- openWRT自学---自己编译的第一个 backfire10.03 版本的过程记录(转)
- Linux top命令
- PowerShell GUI之创建Button和输入框
- linux 时间同步
- Extjs的架构设计思考,单页面应用 or 多页面?
- openstack用bosh安装cloudfoundry(四)---用micro bosh部署bosh
- Linux find命令用法小结
- PropertyGrid控件基础