If SDL2 provides a static version of the library you can compile your project by embedding SDL2 into your library, so your end user only needs to link against your library.
You can view this discussion here: link
link
Static linking works, but I recommend that you use HAVE_LIBC and
Visual C ++ run-time library in this case. SDL implementations for
The specific functions of Visual C ++ may cause problems in another way.
If the attachment completes, it contains a batch file (gmail
did not let me upload as a .bat. Just rename it.) And two C files that
may be similar to your situation. Download the SDL 2 source and
extract it next to these files. I also included the
SDL_config_windows.h for MSVC 2010 if you build with it. I think the
HAVE_X defines for HAVE_LIBC are adapted for 2012.
If you run build.bat in the build environment, it must render a DLL
with SDL 2 statically connected and an executable importing some
works from it. I have some x86 specific options to delete
warnings, but change them to x64 to create a 64-bit build.
Work perfectly.
In addition, it can be useful if we can see how you fit
together. cl.exe and link.exe invocations and all that.
Of course this has licensing implications, but it seems that for version 2 this has been modified as presented here: link
link
Static link
SDL 2.0, unlike 1.2, uses the zlib license, which means you can create a static library connected directly to your program or simply compile the SDL C code directly as part of your project. You are fully authorized to do this. However, we encourage you not to do this for a variety of technical and moral reasons (see docs / README-dynapi.md) and will not cover the details of how in this document. You may not bind SDL 1.2 in most cases because of LGPL licensing, but you really should stop using SDL 1.2 anyway.