linux 生成根:'C在查找包句柄标准参数时出错,cmake:230(消息):找不到Boost(缺少:线程)(找到版本“1.80.0”)'

mwngjboj  于 2023-01-12  发布在  Linux
关注(0)|答案(1)|浏览(438)

构建根:CMake Error at /home/gabriel/repos/my_repo/output/board/host/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Boost (missing: thread) (found version "1.80.0")
我尝试在Buildroot中为嵌入式Linux板构建一个host-ros-cpp-common包,包含以下文件夹的内容:https://github.com/ros/roscpp_core/tree/noetic-devel/cpp_common
我实际上是在上面的版本标签0.5.8处构建该文件夹:https://github.com/ros/roscpp_core/tree/0.5.8/cpp_common
我正在使用gcc-11构建Ubuntu 22.04,并使用gcc-8从Ubuntu 18.04迁移。您知道如何解决此错误吗?另外,(missing: thread)是什么意思?

CMake Error at /home/gabriel/repos/my_repo/output/board/host/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: thread) (found version "1.80.0")

以下是更大的背景:

$ make
...[stuff removed]...
>>> host-ros-cpp-common 0.5.8 Configuring
(mkdir -p /home/gabriel/repos/my_repo/output/board/build/host-ros-cpp-common-0.5.8/cpp_common && cd /home/gabriel/repos/my_repo/output/board/build/host-ros-cpp-common-0.5.8/cpp_common && rm -f CMakeCache.txt && PATH="/home/gabriel/repos/my_repo/output/board/host/bin:/home/gabriel/repos/my_repo/output/board/host/sbin:/home/gabriel/Downloads/Install_Files/gcloud/google-cloud-sdk/bin:/home/gabriel/.local/bin:/home/gabriel/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/go/bin" PKG_CONFIG="/home/gabriel/repos/my_repo/output/board/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_LIBDIR="/home/gabriel/repos/my_repo/output/board/host/lib/pkgconfig:/home/gabriel/repos/my_repo/output/board/host/share/pkgconfig" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1  /home/gabriel/repos/my_repo/output/board/host/bin/cmake /home/gabriel/repos/my_repo/output/board/build/host-ros-cpp-common-0.5.8/cpp_common -DCMAKE_INSTALL_SO_NO_EXE=0 -DCMAKE_FIND_ROOT_PATH="/home/gabriel/repos/my_repo/output/board/host" -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY="BOTH" -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="BOTH" -DCMAKE_INSTALL_PREFIX="/home/gabriel/repos/my_repo/output/board/host" -DCMAKE_C_FLAGS="-O2 -I/home/gabriel/repos/my_repo/output/board/host/include" -DCMAKE_CXX_FLAGS="-O2 -I/home/gabriel/repos/my_repo/output/board/host/include" -DCMAKE_EXE_LINKER_FLAGS="-L/home/gabriel/repos/my_repo/output/board/host/lib -Wl,-rpath,/home/gabriel/repos/my_repo/output/board/host/lib" -DCMAKE_SHARED_LINKER_FLAGS="-L/home/gabriel/repos/my_repo/output/board/host/lib -Wl,-rpath,/home/gabriel/repos/my_repo/output/board/host/lib" -DCMAKE_ASM_COMPILER="/usr/bin/as" -DCMAKE_C_COMPILER="/home/gabriel/repos/my_repo/output/board/host/bin/ccache" -DCMAKE_CXX_COMPILER="/home/gabriel/repos/my_repo/output/board/host/bin/ccache"  -DCMAKE_C_COMPILER_ARG1="/usr/bin/gcc" -DCMAKE_CXX_COMPILER_ARG1="/usr/bin/g++"  -DCMAKE_COLOR_MAKEFILE=OFF -DBUILD_DOC=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLE=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TEST=OFF -DBUILD_TESTS=OFF -DBUILD_TESTING=OFF  -DCMAKE_PREFIX_PATH="/home/gabriel/repos/my_repo/output/board/host//opt/ros/indigo/;/home/gabriel/repos/my_repo/output/board/host/usr" -DCMAKE_INSTALL_PREFIX="/home/gabriel/repos/my_repo/output/board/host//opt/ros/indigo/" )
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/gabriel/repos/my_repo/output/board/host/bin/ccache - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/gabriel/repos/my_repo/output/board/host/bin/ccache - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
CMake Error at /home/gabriel/repos/my_repo/output/board/host/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: thread) (found version "1.80.0")
Call Stack (most recent call first):
  /home/gabriel/repos/my_repo/output/board/host/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /home/gabriel/repos/my_repo/output/board/host/share/cmake-3.25/Modules/FindBoost.cmake:2376 (find_package_handle_standard_args)
  CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/gabriel/repos/my_repo/output/board/build/host-ros-cpp-common-0.5.8/cpp_common/CMakeFiles/CMakeOutput.log".
make[2]: *** [package/pkg-generic.mk:259: /home/gabriel/repos/my_repo/output/board/build/host-ros-cpp-common-0.5.8/.stamp_configured] Error 1
make[1]: *** [Makefile:84: _all] Error 2
make[1]: Leaving directory '/home/gabriel/repos/my_repo/buildroot'
make: *** [Makefile:209: /home/gabriel/repos/my_repo/output/board/images/image.swu] Error 2

我最近从Buildroot将Boost软件包升级到了最新版本,网址是:https://github.com/buildroot/buildroot/tree/master/package/boost,因为boost本身在我的新构建系统gcc-11和Ubuntu 22.04上构建失败。
我也在这里开了一个关于这个的问题:https://github.com/ros/roscpp_core/issues/134
我在这里留下了评论:https://github.com/ethz-asl/kalibr/issues/566#issuecomment-1376788400
我的研究尝试:
1.谷歌搜索Could NOT find Boost (missing: thread) (found version "1.80.0")
更新:我认为问题与这条CMake线有关,但我不知道CMake:https://github.com/ros/roscpp_core/blob/0.5.8/cpp_common/CMakeLists.txt#L4:

find_package(Boost REQUIRED COMPONENTS system thread)
iezvtpos

iezvtpos1#

经过1小时的研究和反复试验...
我的主机是构建机器,即Ubuntu 22.04。它正在为我的主机构建内容(host-ros-cpp-common),因此需要Boost库用于我的主机。因此,构建根 * 目标 *(针对嵌入式Linux ARM核设备)我刚升级的boost包应该跟我的主机没什么关系吧!是针对 target 的,所以,解决方案 * 看起来 * 是简单地将libboost-thread-dev安装到Ubuntu 22.04上,这是我的主机。包libboost-all-dev包含libboost-thread-dev和更多,所以只安装它:

sudo apt update
sudo apt install libboost-all-dev

现在make越过了上一个错误,进入下一个错误!
一定是这样!
功劳:我与ChatGPT进行了一次对话,偶然发现了这个信息。我自己测试了上面的命令。这里所有的单词都是我自己的。

相关问题