escrito en frente
El entorno del autor:
Ubuntu 20.04, ROS-noetic
La siguiente es mi propia solución para su referencia.
1. Descripción del problema
Cuando estaba compilando el programa ROS, que involucraba el programa vision_opencv/cv_bridge
, ocurrió el siguiente error:
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package):
Could not find a package configuration file provided by "boost_python3"
(requested version 1.71.0) with any of the following names:
boost_python3Config.cmake
boost_python3-config.cmake
Add the installation prefix of "boost_python3" to CMAKE_PREFIX_PATH or set
"boost_python3_DIR" to a directory containing one of the above files. If
"boost_python3" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
/usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component)
/usr/share/cmake-3.16/Modules/FindBoost.cmake:443 (find_package)
CMakeLists.txt:17 (find_package)
La captura de pantalla del error es la siguiente:
Dos, la solución
La razón de esto es principalmente
Método de modificación:
reemplace vision_opencv/cv_bridge/CMakeLists.txt
la siguiente declaración en:
if(NOT ANDROID)
find_package(PythonLibs)
if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3)
find_package(Boost REQUIRED python)
else()
find_package(Boost REQUIRED python3)
endif()
else()
find_package(Boost REQUIRED)
endif()
cambie a:
if(NOT ANDROID)
find_package(PythonLibs)
# if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3)
find_package(Boost REQUIRED python)
# else()
# find_package(Boost REQUIRED python3)
# endif()
else()
find_package(Boost REQUIRED)
endif()
Link de referencia
[1] ethz-asl/maplab. Error con la dependencia de refuerzo n.° 368 [EB/OL]. https://github.com/ethz-asl/kalibr/issues/368, 2021-03-02/2023-01-16 [2] (El método de este blog no se ha probado con éxito) Classmate Fei. boost_python3 [EB/OL] .
https://blog.csdn.net/z1872385/article/details/124782647, 2022-05-15/ 2023-01-16.