[SDL] Re : Re : statically linking

Jonathan Dearborn grimfang4 at gmail.com
Wed Dec 1 09:14:26 PST 2010


Instead of linking statically, you could use the linker's -rpath flag to
tell it to look for dynamic libraries in another location.  A typical
compile line might have this appended:
-Wl,-rpath,$ORIGIN
You would double the $ to put it in a Makefile.

Then, just ship the shared object files alongside the executable.

Jonny D


On Wed, Dec 1, 2010 at 11:46 AM, Alberto Luaces <aluaces at udc.es> wrote:

> azer tyuiop writes:
>
> > I did, it change nothing. Maybe it can be helpful so here is my makefile.
> Note that by uncommenting/commenting the two successive lines LDFLAGS (to
> make the lin dynamic) it compile just fine.
> >
> > Apart the static linking, Is there any other way to make my program run
> on a machine that don't have sdl?
>
> If it is the same architecture, you could `ldd' your executable, copy
> all dynamic libraries listed not expected to be in the other system and
> pack them together. Maybe even better is to issue a `ldd' on the other
> machine to know which ones are missing.
>
> As for the linking problem, I'd try to see if I'm able to compile a
> static SDL program without SDL Image first.
>
> --
> Alberto
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20101201/c9e08aec/attachment-0008.htm>


More information about the SDL mailing list