CMake Error: The current CMakeCache.txt编译报错,目录重复
原因是,编译的时候是直接从别人的虚拟机拷贝功能包时,编译好的文件目录和自己在编译的时候目录不匹配,因为是用户名不同所以会报错 ,处理办法如下。
lhcc@LHC-UAV:~/formation_repo$ mm make ARCH=x86
#todo: may change to more gracefully way later.
==============================================
[1/2] Generate build.ninja
==============================================cd build-ninja && cmake -Wno-deprecated -G "Ninja" /home/lhcc/formation_repo -D ARCH=x86
CMake Error: The current CMakeCache.txt directory /home/lhcc/formation_repo/build-ninja/CMakeCache.txt is different than the directory /home/szk/formation_repo/build-ninja 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/lhcc/formation_repo/CMakeLists.txt" does not match the source "/home/szk/formation_repo/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.
make: *** [Makefile:48: build-ninja] Error 1
原因是,编译的时候是直接从别人的虚拟机拷贝功能包时,编译好的文件目录和自己在编译的时候目录不匹配,因为是用户名不同所以会报错 ,处理办法如下。
方法一,简单粗暴,删除CMakeCache.txt,看报错中提到的重复文件。药到病除
更多推荐
所有评论(0)