[SDL] Question re SDLmain Design Concept
William Weilep
william at williamweilep.com
Sun Jun 4 16:15:57 PDT 2006
Doug wrote:
> This is what I did. I just rebuild SDLmain to statically link to the C
> runtime library. As mentioned, I did NOT rebuild SDL.DLL at all - it
> remains unchanged and unmodified.
>
> Before I started investigating this, I had not realized the linking
> structure of SDL, in that I didn't see how SDLmain is code that is part of
> MY application, and SDL.DLL is "external" code that is outside of my main
> application's "sandbox". Since I did NOT want to rebuild all of SDL, I
> ignored this for a while. Since I discovered that I can just rebuild only
> SDLmain to static link to solve my problem, this was a VERY easy solution.
>
> Just in case anyone else made the same mistake I did, there is no
> SDLmain.DLL - there's only an SDLmain.LIB that drops "init" code directly
> into my application's code space.
>
That does indeed sound like the best way to do it on VC2005.
>> VS2005 doesn't let you create an app that just uses MSVCR71.dll or
>> whatever ? That's really bad if it doesn't.
>>
>
> VS2005 uses manifests embedded in the application. These manifests
> indicate what runtime libraries the application requires. Only a release
> build statically-linked application has no EXTERNAL dependencies on a
> runtime library. And since VS2005 is new, a typical WinXP system does not
> have the required runtime libraries present.
>
> Microsoft provides a distro package that installs the runtime libraries
> required - and this is the "best practice". But if you know which runtime
> libraries are needed, you CAN copy them to the application's folder and if
> they are present the application will run. The latter case is not
> recommended my Microsoft as it does an endrun around the SxS assemblies
> management.
>
Oddly, Microsoft's redistributable runtime was compiled with an external
.manifest file which makes it VERY easy for an end user to delete a <1KB
file and break everything as well. Another oddity is that VC2005 is the
first product line for x64 compilation (aside from the Platform SDKs)
yet Windows XP Pro x64 was released first, so has no VC2005 runtimes
included at all either. So far it really seems their x64 work has just
been for preperation for Vista.
More information about the SDL
mailing list