我按照参考手册中的步骤操作,当我运行我的项目时,我收到有关未找到文件的错误。
这就是我所做的。
- 我下载了 MSVC 11 的 bin。
- 将其解压缩到 C:\allegro (bin include 和 lib 目录在里面)
- 在属性下的一个新项目中,我按照他们的指示将 5.0.x 替换为 5.0.8
他们的方向如下:
在 Configuration Properties->C/C++->General 下,在 Additional Include Directories 中输入 c:\allegro\include。
在 Configuration Properties->Linker->General 下,在 Additional Library Directories 中输入 c:\allegro\lib。
在 Configuration Properties->Linker->Input 下,将 allegro-5.0.x-monolith-md-debug.lib 附加到 Additional Dependencies。
在 Configuration Properties->Debugging 下,在 Environment 中输入 PATH=c:\allegro\bin;%PATH%。
也许我附加了错误的文件或没有正确执行?
属性->链接器->输入附加依赖 kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32 .lib;odbccp32.lib;%(AdditionalDependencies);allegro-5.0.8-monolith-md-debug.lib
他们拥有的代码示例是:
#include <stdio.h>
#include <allegro5/allegro.h>
int main(int argc, char **argv)
{
ALLEGRO_DISPLAY *display = NULL;
if(!al_init()) {
fprintf(stderr, "failed to initialize allegro!\n");
return -1;
}
display = al_create_display(640, 480);
if(!display) {
fprintf(stderr, "failed to create display!\n");
return -1;
}
al_clear_to_color(al_map_rgb(0,0,0));
al_flip_display();
al_rest(10.0);
al_destroy_display(display);
return 0;
}
以及它产生的错误:
错误 1 错误 C1083:无法打开包含文件:'stdio.h':没有这样的文件或目录 c:\users\robert\documents\visual studio 2012\projects\allegro-01\allegro-01\main.cpp 1 1 allegro -01 2 IntelliSense:无法打开源文件“io.h”c:\allegro\include\allegro5\platform\almsvc.h 19 1 allegro-01 3 IntelliSense:无法打开源文件“fcntl.h”c:\allegro\ include\allegro5\platform\almsvc.h 20 1 allegro-01 4 IntelliSense:无法打开源文件“direct.h” c:\allegro\include\allegro5\platform\almsvc.h 21 1 allegro-01 5 IntelliSense:无法打开源文件“malloc.h”c:\allegro\include\allegro5\platform\almsvc.h 22 1 allegro-01 6 IntelliSense:无法打开源文件“stdint.h”c:\allegro\include\allegro5\platform\astdint.h 30 4 allegro-01 7 IntelliSense:无法打开源文件“errno.h” c:\allegro\include\allegro5\base.h 23 4 allegro-01 8 IntelliSense:不能打开源文件“limits.h”c:\allegro\include\allegro5\base.h 29 7 allegro-01 9 IntelliSense:无法打开源文件“stdarg.h”c:\allegro\include\allegro5\base.h 34 4 allegro-01 10 IntelliSense:无法打开源文件“stddef.h”c:\allegro\include\allegro5\base.h 35 4 allegro-01 11 IntelliSense:无法打开源文件“stdlib.h”c:\allegro\ include\allegro5\base.h 36 4 allegro-01 12 IntelliSense:无法打开源文件“time.h” c:\allegro\include\allegro5\base.h 37 4 allegro-01 13 IntelliSense:无法打开源文件 "string.h" c:\allegro\include\allegro5\base.h 38 4 allegro-01 14 IntelliSense: 无法打开源文件 "sys/types.h" c:\allegro\include\allegro5\base .h 39 4 allegro-01 15 IntelliSense:标识符“uint32_t”未定义 c:\allegro\include\allegro5\base.h 77 1 allegro-01 16 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5 \utf8.h 57 1 allegro-01 17 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5\utf8.h 58 1 allegro-01 18 IntelliSense:标识符“int32_t”未定义 c:\allegro\include \allegro5\utf8.h 59 1 allegro-01 19 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5\utf8。h 66 1 allegro-01 20 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5\utf8.h 71 1 allegro-01 21 IntelliSense:标识符“va_list”未定义 c:\allegro\include\allegro5\ utf8.h 74 1 allegro-01 22 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5\utf8.h 93 1 allegro-01 23 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\ allegro5\utf8.h 98 1 allegro-01 24 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5\utf8.h 100 1 allegro-01 25 IntelliSense:标识符“int32_t”未定义 c:\allegro\ include\allegro5\utf8.h 134 1 allegro-01 26 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5\utf8.h 135 1 allegro-01 27 IntelliSense:变量“al_ustr_new_from_utf16”可能未初始化 c:\allegro\include\allegro5\utf8.h 138 1 allegro-01 28 IntelliSense:标识符“uint16_t”未定义 c:\allegro\include\allegro5\utf8.h 140 1 allegro-01 29 IntelliSense:标识符“uint16_t”未定义 c:\allegro\include\allegro5\utf8.h 142 1 allegro-01 30 IntelliSense:标识符“ int64_t" 未定义 c:\allegro\include\allegro5\file.h 55 1 allegro-01 31 IntelliSense:标识符 "int64_t" 未定义 c:\allegro\include\allegro5\file.h 56 1 allegro-01 32 IntelliSense:标识符“int64_t”未定义 c:\allegro\include\allegro5\file.h 61 1 allegro-01 33 IntelliSense:标识符“int16_t" 未定义 c:\allegro\include\allegro5\file.h 66 1 allegro-01 34 IntelliSense:标识符 "int16_t" 未定义 c:\allegro\include\allegro5\file.h 67 1 allegro-01 35 IntelliSense:标识符“int16_t”未定义 c:\allegro\include\allegro5\file.h 68 1 allegro-01 36 IntelliSense:标识符“int16_t”未定义 c:\allegro\include\allegro5\file.h 69 1 allegro-01 37 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5\file.h 70 1 allegro-01 38 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5\file.h 71 1 allegro- 01 39 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5\file.h 72 1 allegro-01 40 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5\file.h 73 1 allegro-01 41 IntelliSense:无法打开源文件“assert.h” c:\allegro\include\allegro5\debug.h 22 1 allegro -01 42 IntelliSense:标识符“intptr_t”未定义 c:\allegro\include\allegro5\events.h 206 1 allegro-01 43 IntelliSense:标识符“intptr_t”未定义 c:\allegro\include\allegro5\events.h 207 1 allegro-01 44 IntelliSense:标识符“int64_t”未定义 c:\allegro\include\allegro5\timer.h 55 1 allegro-01 45 IntelliSense:标识符“int64_t”未定义 c:\allegro\include\allegro5\timer。 h 56 1 allegro-01 46 IntelliSense:标识符“int64_t”未定义 c:\allegro\include\allegro5\timer。h 57 1 allegro-01 47 IntelliSense:无法打开源文件“sys/types.h” c:\allegro\include\allegro5\fshook.h 23 4 allegro-01 48 IntelliSense:标识符“uint32_t”未定义 c:\allegro \include\allegro5\fshook.h 96 1 allegro-01 49 IntelliSense:标识符“time_t”未定义 c:\allegro\include\allegro5\fshook.h 97 1 allegro-01 50 IntelliSense:标识符“time_t”未定义 c: \allegro\include\allegro5\fshook.h 98 1 allegro-01 51 IntelliSense:标识符“time_t”未定义 c:\allegro\include\allegro5\fshook.h 99 1 allegro-01 52 IntelliSense:标识符“off_t”未定义c:\allegro\include\allegro5\fshook.h 100 1 allegro-01 53 IntelliSense:标识符“int32_t”未定义 c:\allegro\include\allegro5\fixed.h 30 9 allegro-01 54 IntelliSense:无法打开源文件“string.h”c:\Program Files (x86)\Windows Kits\8.0\Include\shared\guiddef.h 146 1 allegro-01 55 IntelliSense:无法打开源文件“ctype.h” c:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h 31 1 allegro-01 56 IntelliSense:无法打开源文件“excpt .h" c:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h 1240 1 allegro-01 57 IntelliSense:标识符“EXCEPTION_DISPOSITION”未定义 c:\Program Files (x86)\Windows Kits\ 8.0\Include\um\winnt.h 1245 1 allegro-01 58 IntelliSense:无法打开源文件“string.h”c:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h 16534 1 allegro -01 59 智能感知:标识符“va_list”未定义 c:\Program Files (x86)\Windows Kits\8.0\Include\um\WinBase.h 3699 14 allegro-01 60 IntelliSense:标识符“va_list”未定义 c:\Program Files (x86)\ Windows Kits\8.0\Include\um\WinBase.h 3712 14 allegro-01 61 IntelliSense:无法打开源文件“stdarg.h”c:\Program Files (x86)\Windows Kits\8.0\Include\um\WinUser.h 51 1 allegro-01 62 IntelliSense:标识符“va_list”未定义 c:\Program Files (x86)\Windows Kits\8.0\Include\um\WinUser.h 278 10 allegro-01 63 IntelliSense:标识符“va_list”未定义 c :\Program Files (x86)\Windows Kits\8.0\Include\um\WinUser.h 285 10 allegro-01 64 IntelliSense:无法打开源文件“excpt.h”c:\Program Files (x86)\Windows Kits\8.0 \包括\共享\rpc。h 163 1 allegro-01 65 IntelliSense:无法打开源文件“stdlib.h” c:\Program Files (x86)\Windows Kits\8.0\Include\um\combaseapi.h 329 1 allegro-01 66 IntelliSense:无法打开源代码文件“excpt.h”c:\Program Files (x86)\Windows Kits\8.0\Include\um\Windows.h 160 1 allegro-01 67 IntelliSense:无法打开源文件“stdarg.h”c:\Program Files ( x86)\Windows Kits\8.0\Include\um\Windows.h 161 1 allegro-01 68 IntelliSense:无法打开源文件“stdio.h”c:\Users\Robert\Documents\Visual Studio 2012\Projects\allegro-01 \allegro-01\main.cpp 1 1 allegro-01 69 IntelliSense:标识符“atexit”未定义 c:\Users\Robert\Documents\Visual Studio 2012\Projects\allegro-01\allegro-01\main.cpp 8 8 allegro-01 70 IntelliSense:标识符“fprintf" 未定义 c:\Users\Robert\Documents\Visual Studio 2012\Projects\allegro-01\allegro-01\main.cpp 9 7 allegro-01 71 IntelliSense:标识符“stderr”未定义 c:\Users\Robert \Documents\Visual Studio 2012\Projects\allegro-01\allegro-01\main.cpp 9 15 allegro-01 72 IntelliSense:标识符“fprintf”未定义 c:\Users\Robert\Documents\Visual Studio 2012\Projects\allegro -01\allegro-01\main.cpp 15 7 allegro-01 73 IntelliSense:标识符“stderr”未定义 c:\Users\Robert\Documents\Visual Studio 2012\Projects\allegro-01\allegro-01\main.cpp 15 15 快板-01未定义 c:\Users\Robert\Documents\Visual Studio 2012\Projects\allegro-01\allegro-01\main.cpp 9 15 allegro-01 72 IntelliSense:标识符“fprintf”未定义 c:\Users\Robert\Documents \Visual Studio 2012\Projects\allegro-01\allegro-01\main.cpp 15 7 allegro-01 73 IntelliSense:标识符“stderr”未定义 c:\Users\Robert\Documents\Visual Studio 2012\Projects\allegro-01 \allegro-01\main.cpp 15 15 allegro-01未定义 c:\Users\Robert\Documents\Visual Studio 2012\Projects\allegro-01\allegro-01\main.cpp 9 15 allegro-01 72 IntelliSense:标识符“fprintf”未定义 c:\Users\Robert\Documents \Visual Studio 2012\Projects\allegro-01\allegro-01\main.cpp 15 7 allegro-01 73 IntelliSense:标识符“stderr”未定义 c:\Users\Robert\Documents\Visual Studio 2012\Projects\allegro-01 \allegro-01\main.cpp 15 15 allegro-01\Users\Robert\Documents\Visual Studio 2012\Projects\allegro-01\allegro-01\main.cpp 15 15 allegro-01\Users\Robert\Documents\Visual Studio 2012\Projects\allegro-01\allegro-01\main.cpp 15 15 allegro-01