简体   繁体   English

无法将Boost链接到VS2015 RC上基于CMake的项目

[英]Cannot link Boost to CMake-based project on VS2015 RC

It gives the error: 它给出了错误:

LINK : fatal error LNK1104: cannot open file 'boost_unit_test_framework-vc140-mt-gd-1_58.lib' [C:\projects\boost-http\build\algorithm.vcxproj]

You can see the full error at AppVeyor . 您可以在AppVeyor上看到完整的错误。 The build script ( CMakeLists.txt and how cmake is invoked) can be found on the project repository . 可以在项目存储库中找到构建脚本( CMakeLists.txt以及如何调用cmake)。

I've tried a lot, but nothing seems to help. 我已经尝试了很多,但似乎无济于事。 Documentation doesn't help much either. 文档编制也无济于事。 And it is weird that the same code can compile in other platforms. 奇怪的是,相同的代码可以在其他平台上编译。 Help appreciated. 帮助表示赞赏。

The problem is that you define BOOST_TEST_DYN_LINK which according to the Boost.Test docs is used when consuming the dynamically-built Boost.Test lib. 问题是您定义了BOOST_TEST_DYN_LINK ,根据Boost.Test文档,在使用动态构建的Boost.Test库时将使用该文件

Since you have built the static version, you should remove this definition. 由于您已构建静态版本,因此应删除此定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM