CMake Error: The current CMakeCache.txt directory CMakeCache.txt is different than the directory 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怎么解决
时间: 2024-04-27 15:23:25 浏览: 499
这个错误通常是由于在不同的目录中使用相同的CMakeCache.txt文件而导致的。要解决这个问题,可以尝试以下步骤:
1. 删除当前目录中的CMakeCache.txt文件
2. 重新运行CMake命令,确保在正确的目录中运行
3. 如果问题仍然存在,可以尝试手动编辑CMakeCache.txt文件,将其中的所有路径都更新为正确的路径
4. 另外,也可以尝试使用cmake -B build_dir -S source_dir命令来指定构建目录和源代码目录,以确保它们不会混淆。
希望这些步骤能够帮助您解决问题。
相关问题
CMake Error: The current CMakeCache.txt directory /data/server/mysqlb/mysql-5.6.51/CMakeCache.txt is different than the directory /data/install/mysql-5.6.51 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 导致的。解决方法如下:
1. 删除 CMakeCache.txt 文件。
2. 在正确的目录下重新运行 CMake。
3. 确保在重新运行 CMake 时使用正确的参数和选项。
4. 如果您使用的是多个生成目录,请确保每个生成目录都有自己的 CMakeCache.txt 文件。
如果您仍然无法解决这个问题,请提供更多的上下文信息,例如您正在尝试构建什么,使用的操作系统和 CMake 版本等。
CMake Error: The current CMakeCache.txt directory /home/zkc/opencv-4.4.0/build/CMakeCache.txt is different than the directory /home/zkc/software/opencv-4.4.0/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/zkc/opencv-4.4.0/CMakeLists.txt" does not match the source "/home/zkc/software/opencv-4.4.0/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.
这个错误是由于 CMakeCache.txt 文件所在的目录与创建该文件时的目录不同导致的。这可能会导致二进制文件被创建在错误的位置。如果您不确定,请重新编辑 CMakeCache.txt 文件。另外,源文件目录也不匹配,需要使用不同的源目录重新运行 cmake。
阅读全文
相关推荐















