Problem solved: CMake Error at /home/sjh/anaconda3/lib/cmake/Boost-1.73.0/BoostConfig.cmake:141 problem

environment:

Ubuntu18.04 + ROS melodic + Anaconda3

When compiling Tiago's official package with the following command:

catkin build -DCATKIN_ENABLE_TESTING=0 -j $(expr `nproc` / 2)

More than eighty packages have reported errors:

Errors     << gazebo_plugins:cmake /home/sjh/project/Tiago_ws/logs/gazebo_plugins/build.cmake.001.log                                                                                                      
CMake Error at /home/sjh/anaconda3/lib/cmake/Boost-1.73.0/BoostConfig.cmake:141 (find_package):
  Could not find a package configuration file provided by "boost_signals"
  (requested version 1.73.0) with any of the following names:

    boost_signalsConfig.cmake
    boost_signals-config.cmake

  Add the installation prefix of "boost_signals" to CMAKE_PREFIX_PATH or set
  "boost_signals_DIR" to a directory containing one of the above files.  If
  "boost_signals" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  /home/sjh/anaconda3/lib/cmake/Boost-1.73.0/BoostConfig.cmake:258 (boost_find_component)
  /usr/share/cmake-3.10/Modules/FindBoost.cmake:242 (find_package)
  /usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:159 (find_package)
  /home/sjh/project/Tiago_ws/src/gazebo_ros_pkgs/gazebo_dev/cmake/gazebo_dev-extras.cmake:2 (find_package)
  /home/sjh/project/Tiago_ws/devel/share/gazebo_dev/cmake/gazebo_devConfig.cmake:222 (include)
  /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
  CMakeLists.txt:6 (find_package)

At first I thought it was the problem of boost_signals mentioned by other people on the Internet, but the result has not been solved. Later, I found out that it was caused by the conda environment. Just turn off the conda environment and recompile.

First go back to the folder and delete the saved [build] [log] [devel] folder

Then go back to the terminal and close the conda environment

conda deactivate

recompile

catkin build -DCATKIN_ENABLE_TESTING=0 -j $(expr `nproc` / 2)

Compiles normally and succeeds

Guess you like

Origin blog.csdn.net/weixin_45498383/article/details/131781072