在我的代码中,我想使用boost::hash<pair<int, int>>
,为此我需要:
#include <boost/functional/hash.hpp>
我使用cmake
构建我的项目。我应该使用 find_package
请求什么包裹在CMakeLists.txt
?现在我有:find_package(Boost COMPONENTS program_options regex REQUIRED)
。我没有任何错误,但我怀疑其原因是我安装了所有的 boost 库。
最佳答案
Functional 是仅 header 库,因此您不需要添加任何内容,因为不会链接仅 header 库。请参阅Which boost libraries are header-only?也或者http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html#header-only-libraries .
关于c++ - 我应该使用 cmake 搜索什么 Boost 包才能包含 Boost Function 的代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16469823/