[SDL] Re: SDL static linking on windows?
Ryan C. Gordon
icculus at clutteredmind.org
Fri Aug 13 08:58:13 PDT 2004
> I'd be very interested in integrating this archive in the executable in a
> way that still allows it to be accessed through PhysicsFS.
You can append a regular zipfile (compressed or otherwise) to the end of
a Windows .EXE ... PhysicsFS (and most every other ZIP processor) will
read the archive back-to-front looking for the "end of central
directory" record; meanwhile Windows reads the .EXE front-to-back, so
this happens to work. This is also how self-extracting .exe files work,
for the record.
It also means you can extract the data by giving the .exe file to WinZip
or whatever, and it'll think it's a standard zip with some junk at the
start of the file. It's kinda a cool hack.
Here's some example code:
http://svn.icculus.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/physfs/extras/selfextract.c?rev=1.1&view=markup
> I haven't attempted statically linking in SDL yet, so I can't answer
> your question, but I'd be interested in the answer too.
Usual disclaimers about static linking SDL; on Windows, you can supply a
dynamically linked version on demand, but don't have to ship it with the
final package (the LGPL only requires you to hand it over if asked,
which in reality...no one ever does. :) ). This is useful when you're
trying to keep the package small and sane.
PhysicsFS is under the zlib license, which means you can statically link
it, modified or otherwise.
--ryan.
More information about the SDL
mailing list