[SDL] Embed SDL.dll in the .exe
beuc at beuc.net
Thu Sep 27 16:12:54 PDT 2007
> > > > I look for a kind of "partially static" compilation, as if SDL was
> > > > part of my own code, but I don't have enough knowledge of GCC to know
> > > > how that can be done.
> > > >
> > > > Do you know if that's possible?
> > >
> > > Yes, it's possible, you just have to be a bit more specific when
> > > telling the linker what you want to do, since -static affects the
> > > entire linking process and not just part of it like you want. The
> > > linker has some options called -Bstatic and -Bdynamic that can be used
> > > to do exactly what you want, and you can pass args to the linker with
> > > gcc's -Wl arg, with commas in stead of spaces. So, just surround the
> > > libraries you want to link statically with -Wl,-Bstatic and
> > > -Wl,-Bdynamic:
> > >
> > > gcc stuff -Wl,-Bstatic -lSDL etc -Wl,-Bdynamic
While those linker options are not necessary for building .exe with
embedded SDL, there are crucial for building similar Linux binaries.
I find it difficult to insert them in an autoconf+automake build
system (currently I have to override LIBS completely). Does anybody
have experience with this?
More information about the SDL