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.txtfile path is different from the
CMakeCache.txtpath recorded in the compiled file.
CMakeCache.txtfile 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.txtdid not exist. They only appeared after a
catkin_makecompilation. Delete the existing ones and compile again.