Static build of SDL2 appears to expect DLL at runtime

Hi everyone,

I am porting from SDL 1.2 to SDL 2, and so far things have gone smoother than I expected. I built the binaries from source on Windows, and got a simple applications of ours to work. However, I linked against “SDL2.lib”, but it prompts for “SDL2.dll” when I try and run the application. If I supply the binary, it works, but I want to have SDL2 statically linked (thus the lib file). Does the static binary work, and do I have to do something additional to make it work?

Thank you for the great work :slight_smile:

SDL ships Visual Studio projects that build a DLL and an import library.
You’re welcome to switch it to build a static link library, but that’s not
the default.

I haven’t build SDL statically since there are good benefits to keeping it
dynamic. Other people have and reported that there are some quirks with
it, but haven’t submitted patches to fix them. Feel free to report any
bugs (and fixes) on bugzilla:
http://bugzilla.libsdl.org/

Cheers!On Tue, Aug 13, 2013 at 5:55 PM, Joshua Granick wrote:

Hi everyone,

I am porting from SDL 1.2 to SDL 2, and so far things have gone smoother
than I expected. I built the binaries from source on Windows, and got a
simple applications of ours to work. However, I linked against “SDL2.lib”,
but it prompts for “SDL2.dll” when I try and run the application. If I
supply the binary, it works, but I want to have SDL2 statically linked
(thus the lib file). Does the static binary work, and do I have to do
something additional to make it work?

Thank you for the great work :slight_smile:
_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I got it linking, except for one final error. Would you mind taking a look at this bug report?

http://bugzilla.libsdl.org/show_bug.cgi?id=1820

Thank you Sam!On Tue, 13 Aug 2013 23:52:18 -0700, Sam Lantinga wrote:

SDL ships Visual Studio projects that build a DLL and an import library.
You’re welcome to switch it to build a static link library, but that’s not
the default.

I haven’t build SDL statically since there are good benefits to keeping it
dynamic. Other people have and reported that there are some quirks with
it, but haven’t submitted patches to fix them. Feel free to report any
bugs (and fixes) on bugzilla:
http://bugzilla.libsdl.org/

Cheers!

On Tue, Aug 13, 2013 at 5:55 PM, Joshua Granick <@Joshua_Granick>wrote:

Hi everyone,

I am porting from SDL 1.2 to SDL 2, and so far things have gone smoother
than I expected. I built the binaries from source on Windows, and got a
simple applications of ours to work. However, I linked against “SDL2.lib”,
but it prompts for “SDL2.dll” when I try and run the application. If I
supply the binary, it works, but I want to have SDL2 statically linked
(thus the lib file). Does the static binary work, and do I have to do
something additional to make it work?

Thank you for the great work :slight_smile:
_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org