编译 cartographer_ros 出现 CMake Error: The following variables are used in this project, but they are..

编译 cartographer_ros 出现 CMake Error: The following variables are used in this project, but they are set to NOTFOUND.(2021.02.22)

ubuntu版本:20.04
ros版本:noetic

出现如下问题:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
GMOCK_LIBRARY
    linked by target "time_conversion_test" in directory /home/mckros/catkin_ws/src/cartographer_ros/cartographer_ros
    linked by target "time_conversion_test" in directory /home/mckros/catkin_ws/src/cartographer_ros/cartographer_ros
    linked by target "msg_conversion_test" in directory /home/mckros/catkin_ws/src/cartographer_ros/cartographer_ros
    linked by target "msg_conversion_test" in directory /home/mckros/catkin_ws/src/cartographer_ros/cartographer_ros
    linked by target "metrics_test" in directory /home/mckros/catkin_ws/src/cartographer_ros/cartographer_ros
    linked by target "metrics_test" in directory /home/mckros/catkin_ws/src/cartographer_ros/cartographer_ros
    linked by target "configuration_files_test" in directory /home/mckros/catkin_ws/src/cartographer_ros/cartographer_ros
    linked by target "configuration_files_test" in directory /home/mckros/catkin_ws/src/cartographer_ros/cartographer_ros

-- Configuring incomplete, errors occurred!
See also "/home/mckros/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/mckros/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:4520:cmake_check_build_system] 错误 1
Invoking "make cmake_check_build_system" failed

问题提示说:没有找到GMOCK_LIBRARY包
笔者是按照Ubuntu 18.04 安装cartographer方法安装的。

问题解决:
我尝试过使用sudo apt install google-mock安装GMOCK 但是它依旧提示上面的问题。但是我发现我使用 sudo apt install libgmock-dev,他安装了一些包,接下来catkin_make可以发现编译成功

结语

本文也是基于笔者的学习和使用经验总结的,主观性较强,如果有哪些不对的地方或者不明白的地方,欢迎评论区留言交流~

✌Bye

Reference
https://ask.csdn.net/questions/7392012

猜你喜欢

转载自blog.csdn.net/xiaokai1999/article/details/113937073