[SDL] Developing a standalone EXE in VC++ with SDL - possible?

Peter Mackay mackay.pete+sdl at gmail.com
Tue Jan 29 00:05:05 PST 2008


It's static linking of the single source file which makes up
SDLmain.lib, which you would have to static link anyway otherwise the
linker wouldn't find WinMain(). As I understand it, SDLmain.lib is
exempt from the LGPL constraints as there's no other way to use it.

SDL.DLL is linked dynamically, as usual. So no LGPL violations! :-D

Peter

On 29/01/2008, David Olsen <jolynsbass at gmail.com> wrote:
> So, this is not considered static linking of SDL? Hallelujah! You sir, are a
> champion!!!! I've got to try this out on my project now!
> -Dave
>
> ----- Original Message -----
> From: "Peter Mackay" <mackay.pete+sdl at gmail.com>
> To: "A list for developers using the SDL library. (includes SDL-announce)"
> <sdl at lists.libsdl.org>
> Sent: Monday, January 28, 2008 4:06 PM
> Subject: Re: [SDL] Developing a standalone EXE in VC++ with SDL - possible?
>
>
> >I don't have a howto link, but here's a rough guide:
> >
> > 1. Create a new Win32 project
> > 2. Fish SDL_win32_main.c out of the SDL source code and add it to your
> > project.
> > 3. Set the "Character Set" option to "Use Multi-Byte Character Set"
> > (needed for SDL_win32_main.c - possibly a bug?).
> > 4. Add "SDL.lib" to your list of dependencies.
> > 5. Add a main() method as per usual.
> >
> > At this point you should have a functional SDL app. Now to get rid of
> > the unwanted dependencies:
> >
> > 6. Go into the project properties, C/C++ subtree, Code Generation
> > pane, then change "Runtime Library" from "Multi-threaded Debug DLL"
> > and "Multi-threaded DLL" (for Debug and Release configurations
> > respectively) to "Multi-threaded Debug" and "Multi-threaded".
> >
> > That should do it. I verified it just now, and the only dependencies
> > of my app are "SDL.DLL" and "KERNEL32.DLL", as desired.
> >
> > Hope this helps!
> >
> > Peter
> >
> > On 28/01/2008, Stephen Anthony <sa666666 at gmail.com> wrote:
> >> On Monday 28 January 2008 18:09, Peter Mackay wrote:
> >> > It's quite possible to build an exe which behaves in this way using
> >> > VC++ 2005 Express (I've not updated to 2008 yet) by using the non-DLL
> >> > (static) runtime libraries and including SDL_win32_main.c in your
> >> > project instead of SDLmain.lib.
> >>
> >> Please point me to a howto on this if you can.  Since Mingw isn't
> >> supported that well in Vista32, and not at all in Vista64, it would be
> >> nice to duplicate this functionality using Visual Studio.
> >>
> >> Steve
> >> _______________________________________________
> >> SDL mailing list
> >> SDL at lists.libsdl.org
> >> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >>
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>


More information about the SDL mailing list