我很确定这个问题已经在某个地方得到了回答,因为它看起来很基本,但我找不到任何东西。
我正在尝试构建 Qjson 库。为此,我遵循 http://qjson.sourceforge.net/build/ 的构建顺序
我在执行“mingw32-make install”时遇到错误
CMake Error at cmake_install.cmake:51 (file):
file cannot create directory: C:/Program Files (x86)/qjson/lib/cmake/qjson.
Maybe need administrative privileges.
如果我自己创建该文件,稍后会出现另一个错误:
CMake Error at cmake_install.cmake:51 (file):
file INSTALL cannot copy file
所以我猜它仍然是管理员权限。
如何使用管理员权限执行“mingw-make install”?
感谢您的帮助。
最佳答案
因此,按照 francis 的建议,我们采用 B 计划解决方案:更改安装目录,其中 mingw 不需要管理员权限。这将位于我的第二个磁盘 D: 上。
我不知道我的 manip 是否是最好的,但我仍然把它写在这里,以防它能提供帮助:
由于所有内容都已编译,所以我保留了它,我只是修改了 CMakeCache.txt 文件。我改变了什么:
//Directory where to install QJSONConfig.cmake
CMAKECONFIG_INSTALL_DIR:PATH=D:/Qjson
[...other stuff unchanged...]
//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=D:/Qjson
[...other stuff unchanged...]
//The directory the headers are installed in
INCLUDE_INSTALL_DIR:PATH=D:/Qjson/include
//Directory where lib will install
LIB_INSTALL_DIR:STRING=D:/Qjson/lib
然后再次在控制台中:
mingw32-make install
已成功创建 bin、include 和 lib 文件夹。
谢谢。
关于使用管理员权限安装 mingw-make,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27697093/