visual-c++ - 无法使用 Visual C++ 编译快板

标签 visual-c++ compiler-errors allegro visual-c++-2008-express

我刚刚下载了快板库

我创建一个新的空项目,然后添加一个源文件

我添加这行代码:

#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 并执行以下操作:

  • 打开 Visual Studio 命令提示符
  • cd c:\快板
  • mkdir 构建
  • 光盘构建
  • cmake ..
  • 制作

  • 那时,应该构建 Allegro。您也可以通过向 cmake -G "Visual Studio ..." 提供适当的选项来创建 MSVC 项目文件。 .然后,您可以在 Visual Studio 中构建 Allegro。 (虽然运行 nmake 可能更快更省事。)

    如果要构建除通用安装之外的任何东西,则必须拥有所有依赖项。我强烈建议您从以下位置下载一个预构建的 Windows 二进制文件:
  • http://www.allegro.cc/files

  • 并忽略以上关于如何自己构建它的所有内容。

    关于visual-c++ - 无法使用 Visual C++ 编译快板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4309113/

    相关文章:

    c++ - Clang vs GCC vs MSVC - 使用大括号括起来的初始化列表来创建用户定义的类型?

    c# - 我们如何在 VC++ 中使用 .NET dll?

    java - 错误 “The method setDefaultCloseOperation(int) is undefined for the type Frame”

    c++ - 如何将像素转换为索引

    c++ - Allgro 5 'multiple definition of … first defines here …'中的定义错误

    c++ - 如何从重载函数中调用父类成员函数?

    python - 一个简单的 python 程序无法访问我的 dll

    ubuntu - fatal error : mach-o/dyld. h:没有这样的文件或目录

    c - 使用 open() 只读取一个文件,只写入另一个文件

    c - Allegro load_bitmap 不工作