找不到 boost_process cmake find_package

2024-04-11

我正在尝试将 boost 库导入到我的 C++ 项目中,由于某种原因,它找不到 Boost.Process,尽管它找到了其他库。

我的 CMakeLists.txt 文件:

cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
set (PROJECT_NAME "test-stuff" CXX)
project (${PROJECT_NAME})

set(Boost_USE_MULTITHREADED ON)

find_package(Boost 1.64.0 REQUIRED system filesystem process)

if(Boost_FOUND)
  include_directories (SYSTEM ${Boost_INCLUDE_DIR})
endif()

include_directories(include)

file(GLOB SOURCES "src/*.cpp")

add_executable(${PROJECT_NAME} ${SOURCES})

target_link_libraries (${PROJECT_NAME} ${Boost_LIBRARIES})

错误的完整跟踪(带有调试设置):

The CXX compiler identification is AppleClang 8.1.0.8020042
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1039 ] _boost_TEST_VERSIONS = 1.64.0;1.64
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1041 ] Boost_USE_MULTITHREADED = ON
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1043 ] Boost_USE_STATIC_LIBS = 
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1045 ] Boost_USE_STATIC_RUNTIME = 
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1047 ] Boost_ADDITIONAL_VERSIONS = 
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1049 ] Boost_NO_SYSTEM_PATHS = 
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1117 ] Declared as CMake or Environmental Variables:
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1119 ]   BOOST_ROOT = 
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1121 ]   BOOST_INCLUDEDIR = 
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1123 ]   BOOST_LIBRARYDIR = 
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1125 ] _boost_TEST_VERSIONS = 1.64.0;1.64
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1200 ] Include debugging info:
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1202 ]   _boost_INCLUDE_SEARCH_DIRS = PATHS;C:/boost/include;C:/boost;/sw/local/include
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1204 ]   _boost_PATH_SUFFIXES = boost-1_64_0;boost_1_64_0;boost/boost-1_64_0;boost/boost_1_64_0;boost-1_64;boost_1_64;boost/boost-1_64;boost/boost_1_64
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1224 ] location of version.hpp: /usr/local/include/boost/version.hpp
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1248 ] version.hpp reveals boost 1.64.0
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1334 ] guessed _boost_COMPILER = 
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1344 ] _boost_MULTITHREADED = -mt
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1388 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1390 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1452 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/local/include/lib;/usr/local/include/../lib;/usr/local/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib_boost_LIBRARY_SEARCH_DIRS_DEBUG   = /usr/local/include/lib;/usr/local/include/../lib;/usr/local/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1597 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-mt-1_64;boost_system-mt;boost_system
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:371 ]  Boost_LIBRARY_DIR_RELEASE = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1646 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-mt-d-1_64;boost_system-mt-d;boost_system-mt;boost_system
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:371 ]  Boost_LIBRARY_DIR_DEBUG = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1597 ] Searching for FILESYSTEM_LIBRARY_RELEASE: boost_filesystem-mt-1_64;boost_filesystem-mt;boost_filesystem
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:371 ]  Boost_LIBRARY_DIR_RELEASE = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1646 ] Searching for FILESYSTEM_LIBRARY_DEBUG: boost_filesystem-mt-d-1_64;boost_filesystem-mt-d;boost_filesystem-mt;boost_filesystem
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:371 ]  Boost_LIBRARY_DIR_DEBUG = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
CMake Warning at /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1566 (message):
  No header defined for process; skipping header check
Call Stack (most recent call first):
  CMakeLists.txt:19 (find_package)


-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1597 ] Searching for PROCESS_LIBRARY_RELEASE: boost_process-mt-1_64;boost_process-mt;boost_process
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:371 ]  Boost_LIBRARY_DIR_RELEASE = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1646 ] Searching for PROCESS_LIBRARY_DEBUG: boost_process-mt-d-1_64;boost_process-mt-d;boost_process-mt;boost_process
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:371 ]  Boost_LIBRARY_DIR_DEBUG = /usr/local/lib _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/local/lib;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1719 ] Boost_FOUND = 1
CMake Error at /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1879 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.64.0

  Boost include path: /usr/local/include

  Could not find the following Boost libraries:

          boost_process

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:19 (find_package)

我知道 Boost.Process 仅包含在 Boost 1.64 及更高版本中,但根据输出,我正在使用 Boost 1.64 和 Cmake 3.9。我查看了 /usr/local/include/boost 和 process.hpp 就在那里。

感谢您的任何建议。


因此,经过几个小时的头撞墙后,我意识到我不需要使用 find_package 导入 Boost.Process,因为它是一个仅包含头文件的库 (argggg)。我删除了 CMakeList.txt 中的“进程”导入,并且 ta-dah:它起作用了。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

找不到 boost_process cmake find_package 的相关文章

随机推荐

  • Firestore 每日配额

    我使用开发了一个示例应用程序Angular and 火库 我大约两个月前部署了我的应用程序 从那时起一直运行良好 然而 在上周 我注意到该应用程序在使用几个小时后因 客户端离线 错误而被阻止 我发现使用2个小时后我超出了每日的阅读操作限额
  • 在负载平衡的 Tornado 站点上使用 apache 基准测试获取失败的请求,但没有记录

    也许这是一个关于 ab 的问题 而不是关于 Tornado 的问题 但有些事情没有意义 我这样运行基准测试 ab n 100 http localdomainname 2 tornados being 1 nginx Concurrency
  • python 2 doctest 为何会失败,但失败消息中的值却没有差异?

    我在 Windows 中使用 Python 2 7 9 我有一个 UTF 8 编码的 python 脚本文件 其中包含以下内容 coding utf 8 def test func u gt gt gt test func u return
  • 以 RTL 格式格式化时 TextView 内的数字会反转

    里面的数字TextView以 RTL 格式格式化时会发生反转 当数字位于文本内的末尾时TextView他们逆转了 我怎样才能以编程方式解决这个问题 例如 下面的数字是相反的 它们应该显示为 误解 像 ARABIC 这样的 RTL 语言中的数
  • 如何解决对等依赖安装问题

    我正在尝试使用 npm 安装react contenteditable 但是 eslint 的对等依赖项不允许我安装以下错误的 risal 我正在使用 Ubuntu 18 04 LTS 操作系统 这是我用来安装react contented
  • 根据控制器指定不同的_Layout.cshtml

    我创建了一个 asp mvc3 项目 我想要根据选择的控制器有不同的 Layout cshtml 这是因为控制器 1 有 2 个按钮 控制器 2 有 3 个按钮 控制器 3 有 4 个按钮 每个控制器适用于特定类型的用户 因此取决于登录 我
  • Laravel 中的 Socket.io 轮询 404

    我正在尝试使用 Socket io 实现一个聊天应用程序 进入我的 Laravel 应用程序 聊天应用程序本身运行良好 但我在 Laravel 中遇到问题 我尝试在端口 8000 上提供 Laravel 服务 并在 8000 上提供聊天服务
  • 访问回调 user_is_anonymous 的反义词是什么?

    我知道在 drupal 模块中使用它来指定只有匿名用户才能看到该模块 仅指定登录用户的回调是什么 我有一个页面 我只想让登录用户访问 谢谢 它是用户 is logged in http api drupal org api function
  • 在 AVD 上运行自定义 ROM

    有谁知道是否可以在 AVD 上运行自定义 ROM 我该怎么做 谢谢 如果您自己构建自定义 rom 则在构建自定义 rom 后 您可以使用以下命令启动它emulator 但要做到这一点 你首先需要为模拟器构建 ROM 通常 full gene
  • 数据库结果的数组结构

    这可能是一个非常微不足道的问题 但是以下哪种方法是构造返回数据库结果的数组的最佳实践 比如说博客文章列表 对文章进行排序和分组 或者对元素进行排序和分组 Array title gt Array 0 gt Untitled 1 gt Unt
  • current_prolog_flag double_quotes DCG(代码或字符)?

    在使用 SWI Prolog DCG 时 我注意到有些人注意到 set prolog flag double quotes codes Jan http www swi prolog org pldoc man section string
  • 为什么正则表达式 ((x,y)|(x,z)) 是不确定的?

    为什么正则表达式 x y x z 像 Core Java 一书中所说的那样是不确定的 作者给出了他的观点 当解析器看到 x 时 它不知道采取两个替代方案中的哪一个 这个表达式可以以确定性形式重写为 x y z 谁能给我一个解释吗 为了具有确
  • Android 活动上下文为空

    所以我这里有这些代码 它运行时不会崩溃 但是 当我将 this 传递到网格适配器时 mContext 为空 我尝试传递 getApplicationContext 但仍然无法使 getImage 方法正常运行 因为 getResources
  • 我将如何获得 WPF Windows 应用程序的许可[关闭]

    Closed 这个问题需要多问focused help closed questions 目前不接受答案 我开发了一个小型应用程序 我想尝试并销售它 但我不熟悉如何最好地做到这一点 我将如何锁定该程序以供试用1 我将如何处理接受付款 考虑到
  • SASS 或 LESS 关键帧百分比循环

    我正在测试一些特殊的东西 我正在尝试在关键帧内循环以动态地将百分比写入其中 我已经用 SASS 测试过类似的东西 但它不起作用 keyframes test for i from 0 through 100 i do special stu
  • Mercurial:保持两个分支同步但存在某些持久差异?

    我是一名使用 django 自己工作的 Web 开发人员 我正在尝试了解如何最好地使用 Mercurial 部署网站 我想要的是能够保留一个可用于生产和开发工作的存储库 生产 开发之间总会存在一些差异 例如 它们可能使用不同的数据库 开发总
  • docker 容器中的 Rails 应用程序在开发中不会重新加载

    我跟着这个docker compose 教程 https docs docker com compose rails 关于如何启动 Rails 应用程序 它运行完美 但当我更改控制器时 应用程序不会重新加载 还可以缺少什么吗 我也遇到了这个
  • 在 R6 类上定义括号 (`[`) 运算符

    这是不起作用的 library R6 Foo R6 R6Class Foo public list X NULL metadata NULL initialize function X metadata self X X self meta
  • DropDownListFor, selected = true 不起作用

    Select 对于 DropDownListFor 不起作用 谁能帮我 我有音乐类别和属于某一音乐类别的艺术家 在我的页面上 我想显示艺术家详细信息 并且我希望下拉列表加载所有音乐类别 并选择指定的艺术家音乐类别 但我无法在下拉列表中选择一
  • 找不到 boost_process cmake find_package

    我正在尝试将 boost 库导入到我的 C 项目中 由于某种原因 它找不到 Boost Process 尽管它找到了其他库 我的 CMakeLists txt 文件 cmake minimum required VERSION 3 9 FA