如何编译SDL程序并在没有DLL的情况下运行它 [英] How to compile SDL program and run it without DLL
问题描述
是否可以将SDL库程序编译为exec并在没有 sdl.dll的情况下运行它?
is it possible to compile SDL library program into exec and run it without having "sdl.dll"?
例如,假设我编写了sdl程序,它就可以工作而除了事情外,所有事情都是在Windows上运行该程序,我需要在同一文件夹或系统文件夹中包含 sdl.dll。是否可以对其进行编译,以便我可以随身携带exec,而无需同时包含 sdl.dll?
for example let say i wrote sdl program and it works and everything but the thing is to run the program on windows, i need to have "sdl.dll" within the same folder or system folder. is it possible to compile it so that i can just take the exec with me without needing to have "sdl.dll" along with it?
我正在使用Visual Studio 2010
i am using visual studio 2010 express.
推荐答案
通常,此类操作的过程是:
Typically the procedure for this kind of stuff is:
- 下载该库的源代码。在SDL的情况下: http://www.libsdl.org/download-1.2.php
- 将计算机上的库构建为静态lib(在Windows上为.lib)。
- 将.lib放入一些文件夹以及项目的其余部分,并设置项目属性以链接到该文件夹。不要忘记头文件。
这些步骤在Windows上可能更麻烦,因为源代码发行版可能不像Windows友好。有些人可能拥有Visual Studio项目,另一些人可能会强迫您使用nmake。
These steps can be more of a pain on Windows because source code distros may not be as Windows friendly. Some might have Visual Studio projects, others might force you to use nmake.
这篇关于如何编译SDL程序并在没有DLL的情况下运行它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!