当尝试在MSYS2上安装Google测试时,我使用:
cmake -G"MSYS Makefiles" ..
make
这有效,代码生成无误。然后,安装:
make install
不幸的是,这不起作用。似乎是一个常见问题,其他软件包也有类似问题。
-- Installing: C:/Program Files/googletest-distribution/include
CMake Error at googlemock/cmake_install.cmake:31 (file):
file INSTALL cannot make directory "C:/Program
Files/googletest-distribution/include": No such file or directory
Call Stack (most recent call first):
cmake_install.cmake:32 (include)
这是权限问题吗?我尝试了sudo,但是在msys2上不存在。
错误的第31行似乎有误,这是一条评论:
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for each subdirectory.
include("D:/git/extcode/googletest/build/googlemock/cmake_install.cmake")
endif()
第32行是include,它引用d :,而不是c :,所以我不明白所生成的消息吗?