CMake Error: The source “xxx“ does not match the source “yyy“ used to generate cache. Re-run cmake

简介: CMake Error: The source “xxx“ does not match the source “yyy“ used to generate cache. Re-run cmake

场景复现

今天使用CMake再次编译fmt源码时,cmake抛出一个错误。告诉我找不到一个路径,但我这个电脑本就没有这个路径。仔细一看这个路径是我在另一个电脑编译的路径。我就猜测可能是缓冲文件在捣乱。

CMake Error: The source “E:/C++Project/fmt/CMakeLists.txt” does not match the source “F:/C++Project/fmt/CMakeLists.txt” used to generate cache. Re-run cmake with a different source directory.


cmake界面:

解决方案

找到我们的编译路径

删掉这个文件,这个文件保留了上次的编译的信息。

重新使用CMake编译

重新使用cmake编译,就不会抛出这种错误了。可以正常编译咯。

目录
相关文章
|
1月前
|
Java
No tag [else] defined in tag library imported with prefix [c]] with root cause
No tag [else] defined in tag library imported with prefix [c]] with root cause 错误处理
28 0
|
Linux
configure: error: cannot guess build type; you must specify one
configure: error: cannot guess build type; you must specify one
363 0
|
1月前
|
C++ Windows
CMake中的find_package(xxx REQUIRED)在windows平台怎么解
CMake中的find_package(xxx REQUIRED)在windows平台怎么解
|
9月前
cancal报错 config dir not found
cancal报错 config dir not found
关于 CMake编译出出现错误“Could not find compiler set in environment variable RC:” 的解决方法
关于 CMake编译出出现错误“Could not find compiler set in environment variable RC:” 的解决方法
关于 CMake编译出出现错误“Could not find compiler set in environment variable RC:” 的解决方法
|
JavaScript
The file is in the program because: Imported via xxx Root file specified for compilation Vetur(1261)
The file is in the program because: Imported via xxx Root file specified for compilation Vetur(1261)
136 0
The file is in the program because: Imported via xxx Root file specified for compilation Vetur(1261)
|
开发工具
Failed to find Build Tools revision 25.0.2
Failed to find Build Tools revision 25.0.2
91 0
|
JavaScript 前端开发
【build your own xxx】实现你自己的call和apply
【build your own xxx】实现你自己的call和apply
【build your own xxx】实现你自己的call和apply
|
开发工具 Android开发
Failed to find Build Tools revision 28.0.3
Failed to find Build Tools revision 28.0.3
255 0
Failed to find Build Tools revision 28.0.3