When you start to learn ROS, you need to compile other people's function packages, and often use other people's workspaces, but various errors will occur during compilation, such as the following directory problems:
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.
CMakeCache.txt
file path is different from the CMakeCache.txt
path recorded in the compiled file.CMakeCache.txt
file according to the record, but I don’t understand this.) The second error is also because the original record is inconsistent with the current directory, but it is the CMakeLists.txt
file.CMakeCache.txt
and CMakeLists.txt
did not exist. They only appeared after a catkin_make
compilation. Delete the existing ones and compile again..../build/CMakeCache.txt
and recompile.../src/CMakeLists.txt
and recompile