How to compile SDL program and run it without DLL

一世执手 提交于 2019-12-10 10:54:24

问题


is it possible to compile SDL library program into exec and run it without having "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?

i am using visual studio 2010 express.


回答1:


Typically the procedure for this kind of stuff is:

  1. Download the source code for the library. In SDL's case: http://www.libsdl.org/download-1.2.php.
  2. Build the library on your machine into a static lib (on Windows, this would be a .lib).
  3. Drop the .lib in some folder along with the rest of your project and set up the project properties to link to it. Don't forget about the header files.

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.



来源:https://stackoverflow.com/questions/8827922/how-to-compile-sdl-program-and-run-it-without-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!