如果你需要迅速完成Allegro的配置,从而立刻开始你的工作或研究,可以按照以下方法:
一、安装VS2005
二、下载Allegro,你可以从http://www.ds0101.com/下载到许多关于Allegro的资料~
三、将下载的Allegro中的 bin文件夹内的3个DLL文件
alld42.dll
alleg42.dll
alleg42.dll
和Lib中的一个
alld42.pdb
复制到Windows\system32文件夹下。
四、在VS中,新建一个“空”项目或工程,并且这个工程应该是win32应用程序,而不是控制台程序。
PS:函数入口还是main(),而不是winmain(),之间的转换Allegro会帮你完成。如果你不小心建成了console,没问题,直接在工程[属性]-[连接器]-[系统]-[子系统]中选择/SUBSYSTEM:WINDOWS。
否则你将碰到以下函数入口错误
MSVCRTD.lib(crtexe.obj) : error LNK2019: 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用
d:\My Documents\Visual Studio 2005\Projects\test\Debug\test.exe : fatal error LNK1120: 1 个无法解析的外部命令
五、在项目的[属性]->[连接器]->[输入]->[附加依赖项] 中填写 alleg.lib
六、复制以下代码以检验配置情况
#include <allegro.h>
int main(void)
{
allegro_init();
allegro_message("Hello World!");
return 0;
}
END_OF_MAIN()
--------------------------------------------无敌分割线--------------------------------------------------------------
如果程序运行时弹出警告窗口,并在VS调试窗口出现以下情况
“asd.exe”: 已加载“C:\WINDOWS\system32\alleg42.dll”,未使用调试信息生成二进制文件。
LDR: LdrpWalkImportDescriptor() failed to probe C:\WINDOWS\system32\alleg42.dll for its manifest, ntstatus 0xc0150002
调试器:: 在进程加载过程中引发了未处理的无法继续的异常
程序“[1996] asd.exe: 本机”已退出,返回值为 -1072365566 (0xc0150002)。
你可以从http://www.allegro.cc/files/4.2.2/alleg42.dll下载并复制到winodows/system32文件夹下,再运行就没问题了。
--------------------------------------------无敌分割线--------------------------------------------------------------
以下是详细信息,为有高级需要的朋友准备
Configuration | Key | Value |
---|---|---|
Release | C/C++ / Code Generation / Runtime Library | Multi-threaded DLL (/MD) |
^ | Linker / Input / Additional Dependencies | alleg.lib |
Debug | C/C++ / General / Debug Information Format | Program Database for Edit & Continue (/ZI) |
^ | C/C++ / Optimization / Optimization | Disabled |
^ | C/C++ / Code Generation / Runtime Library | Multi-threaded Debug DLL (/MDd) |
^ | Linker / Input / Additional Dependencies | alld.lib |
^ | Linker / Debugging / Generate Debug Info | Yes (/DEBUG) |
Profile | C/C++ / Code Generation / Runtime Library | Multi-threaded DLL (/MD) |
^ | Linker / Input / Additional Dependencies | allp.lib |
Static Release | C/C++ / Preprocessor / Preprocessor Definitions | ALLEGRO_STATICLINK |
^ | C/C++ / Code Generation / Runtime Library | Multi-threaded DLL (/MD) |
^ | Linker / Input / Additional Dependencies | alleg_s.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib dinput.lib ddraw.lib dxguid.lib winmm.lib dsound.lib |
^ | Linker / Command Line / Additional Options | /LTCG |
Static Release, Static Runtime | C/C++ / Preprocessor / Preprocessor Definitions | ALLEGRO_STATICLINK |
^ | C/C++ / Code Generation / Runtime Library | (/MT) |
^ | Linker / Input / Additional Dependencies | alleg_s_crt.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib dinput.lib ddraw.lib dxguid.lib winmm.lib dsound.lib |
^ | Linker / Command Line / Additional Options | /LTCG |
Static Debug | C/C++ / General / Debug Information Format | Program Database for Edit & Continue (/ZI) |
^ | C/C++ / Optimization / Optimization | Disabled |
^ | C/C++ / Preprocessor / Preprocessor Definitions | ALLEGRO_STATICLINK |
^ | C/C++ / Code Generation / Runtime Library | Multi-threaded Debug DLL (/MDd) |
^ | Linker / Input / Additional Dependencies | alld_s.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib dinput.lib ddraw.lib dxguid.lib winmm.lib dsound.lib |
^ | Linker / Debugging / Generate Debug Info | Yes (/DEBUG) |
Static Profile | C/C++ / Preprocessor / Preprocessor Definitions | ALLEGRO_STATICLINK |
^ | C/C++ / Code Generation / Runtime Library | Multi-threaded DLL (/MD) |
^ | Linker / Input / Additional Dependencies | allp_s.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib dinput.lib ddraw.lib dxguid.lib winmm.lib dsound.lib |
--------------------------------------------无敌分割线--------------------------------------------------------------
如果需要原文,可以访问以下地址:
http://wiki.allegro.cc/VisualCExpress2005#Deployment.