
零、问题描述 开始学ROS时,需要编译别人的功能包,常常把别人的工作空间拿过来使用,但编译时会出现各种错误,如下的目录问题: CMake Error: The current CMakeCache.txt directory /home/vistar/desktop/catkin_ws/build/CMakeCache.txt is different than the directory /home/vistar/桌面/catkin_ws/build where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
CMake Error: The source “/home/vistar/desktop/catkin_ws/src/CMakeLists.txt” does not match the source “/home/vistar/桌面/catkin_ws/src/CMakeLists.txt” used to generate cache. Re-run cmake with a different source directory. Invoking “cmake” failed.
一、问题分析
二、解决办法
最省事的方法:直接将 /build 和 /devel 目录删掉,重新编译 (感谢 如约—————而至、weixin_43216765 的提醒,2022-08-28)
三、总结 自己试出来的方法,也许可以通过修改某个文件来解决,如果你有更好的办法,希望可以在下面留言,谢谢你的分享。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/211016.html原文链接:https://javaforall.cn