boost.test和对boost.thread的依赖性



我正在尝试在Windows版本1.62.0上构建boost.test。我正在构建 - 测试和我的输出文件是libboost_unit_test_framework-vc140-mt-gd-1_62.lib/dll

一切都很好,但是当我在项目中添加unit_test.hpp标头时,链接器会补充libboost_thread-vc140-mt-vc140-mt-gd-1_62.lib无法找到。

我感到惊讶,我的印象是,当我构建时 - 使用B2,将构建所有依赖性。它也应该构建线程吗?

i双倍和三倍检查,以查看我的项目是否没有带入线程。HPP标头 - 没有。它设置为自动链接libs。

我还运行了BCP

bcp - boost = b: temp boost_1_62_0- list test

在Boost/Test文件夹上,它似乎确实列出了线程文件:

Boost thread.hpp
....
libs thread build has_atomic_flag_l
libs thread build jamfile.v2
libs thread src future.cpp
libs thread src pthread ash.cpp
libs thread src pthread ashred_atomic
libs thread src pthread thread.cpp
libs thread src tss_null.cpp
libs thread src win32 thread.cpp
libs thread src win32 tss_dll.cpp
libs thread src win32 tss_pe.cpp

我有一种感觉,我不完全了解发生了什么。

boost.unit取决于boost.thread?

如果是这样,为什么不通过B2自动构建。如果不是,这可能是依赖性来自...

谢谢,

andrzej

我的印象是,当我构建 - 测试时,使用b2,将构建boost的所有依赖项。

您的印象错误;--with-test只是构建test库。您显然也需要构建boost thread

我很遗憾地说我不知道还有其他依赖性,因为我总是执行boost的完整构建,并且它使用Visual Studio执行auto-linking ...

注意:对于Visual Studio boost thread,必须使用动态链接构建,因此将link=shared添加到b2命令中。

请参阅如何在Windows上构建Boost?有关更完整的描述。

最新更新