CMake Error: The current CMakeCache.txt directory is different...
使用 NXP sdk编译时会出现如下错误:
CMake Error: The current CMakeCache.txt directory /home/***/build/CMakeCache.txt is different than the directory /home/***/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/***/CMakeLists.txt” does not match the source “/home/***/CMakeLists.txt” used to generate cache. Re-run cmake with a different source directory.
Invoking “cmake” failed.
一、问题分析
错误提示翻译一下就是你现在的CMakeCache.txt 文件路径和编译文件记录的CMakeCache.txt 路径不一样。
这是因为之前在别的地方使用别人的环境编译了一次,生成了build目录及里面的文件,在这里再次编译时发现与原来的路径不对造成的。总之问题应该是:这不是第一次编译,其中有些编译生成的文件,导致二次编译时报错。
二、解决办法
将…/build/CMakeCache.txt这个目录中的build目录整个删除就ok了。
三、总结
如果你有更好的办法,希望可以在下面留言,谢谢你的分享
本文介绍了解决CMakeCache.txt路径不匹配的问题,通常出现在使用NXPsdk编译过程中。文章分析了错误产生的原因,并提供了一种简单有效的解决办法——删除build目录。
2029

被折叠的 条评论
为什么被折叠?



