C++项目更改位置或重命名后无法编译与运行

错误内容:

CMake Error: The current CMakeCache.txt directory /home/xiexiaotong/桌面/yolov5_tensorRT/build/CMakeCache.txt is different than the directory /home/xiexiaotong/桌面/tensorrtx/yolov5/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/xiexiaotong/桌面/yolov5_tensorRT/CMakeLists.txt” does not match the source “/home/xiexiaotong/桌面/tensorrtx/yolov5/CMakeLists.txt” used to generate cache. Re-run cmake with a different source directory.

解决方法

这个错误提示是由于 CMakeCache.txt 目录与创建 CMakeCache.txt 的目录不同导致的。这可能会导致二进制文件被创建在错误的位置。
只要删除build,然后重新编译就行了

猜你喜欢

转载自blog.csdn.net/xxt228/article/details/129768209