我刚刚下载了快板库
我创建一个新的空项目,然后添加一个源文件
我添加这行代码:
#include <allegro.h>
我编译并得到以下错误:
c:\allegro\include\allegro5\internal\alconfig.h(28) : fatal error C1083: Cannot open include file: 'allegro5/platform/alplatf.h': No such file or directory
所以我进入 alconfig.h 并更改:
#include "allegro5/platform/alplatf.h"
到:
#include "../../allegro5/platform/alplatf.h.cmake"
它现在给了我这个错误:
c:\allegro\include\allegro5\platform\alplatf.h.cmake(2) : fatal error C1021: invalid preprocessor command 'cmakedefine'
所以我摆脱了
#include "../../allegro5/platform/alplatf.h.cmake"
声明然后说:c:\allegro\include\allegro5\internal\alconfig.h(57) : fatal error C1189: #error : platform not supported
我不知道从那里去,我正在运行 Windows,所以我真的很难过
最佳答案
看起来您正在尝试使用源版本,甚至没有构建它。有关如何构建它的信息,请参阅随附的说明。简而言之,您需要安装 cmake 并执行以下操作:
那时,应该构建 Allegro。您也可以通过向
cmake -G "Visual Studio ..."
提供适当的选项来创建 MSVC 项目文件。 .然后,您可以在 Visual Studio 中构建 Allegro。 (虽然运行 nmake
可能更快更省事。)如果要构建除通用安装之外的任何东西,则必须拥有所有依赖项。我强烈建议您从以下位置下载一个预构建的 Windows 二进制文件:
并忽略以上关于如何自己构建它的所有内容。
关于visual-c++ - 无法使用 Visual C++ 编译快板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4309113/