问题
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:
- Download the source code for the library. In SDL's case: http://www.libsdl.org/download-1.2.php.
- Build the library on your machine into a static lib (on Windows, this would be a .lib).
- 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