【问题标题】:Installing Allegro安装 Allegro
【发布时间】:2018-08-09 00:34:24
【问题描述】:

我一直按照this 程序安装 Allegro。在我到达第 3 点之前一切正常,我必须运行这些命令

cd C:\devel\a5_sourcepack\zlib mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=C:\MinGW -G "MinGW Makefiles" mingw32-make install

  1. “build”目录已经存在,我不知道为什么要创建它。
  2. 我尝试使用已经存在的构建目录并运行以下命令,但它给了我

    C:\devel\a5_sourcepack\zlib\build>cmake .. -DCMAKE_INSTALL_PREFIX=C:\MinGW -G "MinGW Makefiles" CMake Error: The current CMakeCache.txt directory C:/devel/a5_sourcepack/zlib/build/CMakeCache.txt is different than the directory c:/dev/a5_sourcepack/zlib/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 "C:/devel/a5_sourcepack/zlib/CMakeLists.txt" does not match the source "C:/dev/a5_sourcepack/zlib/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.

我什至尝试运行最后一个命令mingw32-make install,但它告诉我没有这样的命令。

【问题讨论】:

  • 除非将其添加到您的环境变量中,否则 mingw 的任何命令都无法在安装文件夹之外运行。 mingw 是否添加为系统变量?

标签: cmake allegro


【解决方案1】:

删除构建目录并重新创建它(使用mkdir)。或者,从构建目录中删除所有文件。

然后执行带有所需参数的cmake 命令。


错误消息是不言自明的:看来您首先在C:/dev/a5_sourcepack/zlib 下有源代码,然后尝试在build/ 子目录中构建它们。然后将源移动到C:/devel/a5_sourcepack/zlib(可能通过将dev 目录重命名为devel)。

但是一旦创建了 CMake 构建文件(在运行 cmake ... 时),则不应移动源目录和构建目录。否则构建文件无效。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多