Static link

Hello,

How do I link a program statically with SDL and SDL_image ?

sdl-config --static-libs

reports:

-L/usr/lib -lSDL -lpthread

which does’t look like anything static …

Thanks,
Julien_____________________________________________________________________________
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr

Static linking is determined by the options passed to GCC (well,
actually ld, but 99% of the time one does linking via GCC).

Try ‘man gcc’.

Or -static if you’re REALLY lazy.

I’m sure you know this, but as SDL is LGPL, anything you link statically
and release must be licenced as LGPL or GPL.

Eddy

julien CLEMENT wrote:> Hello,

How do I link a program statically with SDL and SDL_image ?

sdl-config --static-libs

reports:

-L/usr/lib -lSDL -lpthread

which does’t look like anything static …

Thanks,
Julien


Envoy? avec Yahoo! Mail
http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52423/*http://fr.docs.yahoo.com/mail/overview/index.html.
Une boite mail plus intelligente.



SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Or, alternatively, when you release your statically-linked binary,
also provide an object that can be re-linked with updated versions of the
LGPL’d libraries, such as SDL. (In other words, give your users the
freedom to re-link with versions of libraries that have bug fixes,
security, fixes, enhancements, etc.)

http://en.wikipedia.org/wiki/LGPL is a good starting point to learn more.

I am not a lawyer. :)On Tue, Jun 24, 2008 at 07:10:50PM +0100, Edward Cullen wrote:

I’m sure you know this, but as SDL is LGPL, anything you link statically
and release must be licenced as LGPL or GPL.


-bill!
“Tux Paint” - free children’s drawing software for Windows / Mac OS X / Linux!
Download it today! http://www.tuxpaint.org/

Hehe,

Me either.

I think what you’re suggesting is a thin wrapper that you link
statically into your code, but is linked dynamically to SDL?

I’ve seen this in some ‘system’ libs; the .a file doesn’t actually
contain the code, just re-directs to the .so (in code not symlink).

This isn’t actually static linking, it’s dynamic linking in disguise, so
LGPL constraints wouldn’t apply. But then, you’re not getting the
’benefits’ of static linking.

In other words; don’t link statically unless you’re on an embedded
platform that either doesn’t support dynamic linking or you need to
save the overhead of dynamic linking (which ONLY applies to embedded
platforms).

Eddy

Bill Kendrick wrote:> On Tue, Jun 24, 2008 at 07:10:50PM +0100, Edward Cullen wrote:

I’m sure you know this, but as SDL is LGPL, anything you link statically
and release must be licenced as LGPL or GPL.

Or, alternatively, when you release your statically-linked binary,
also provide an object that can be re-linked with updated versions of the
LGPL’d libraries, such as SDL. (In other words, give your users the
freedom to re-link with versions of libraries that have bug fixes,
security, fixes, enhancements, etc.)

http://en.wikipedia.org/wiki/LGPL is a good starting point to learn more.

I am not a lawyer. :slight_smile:

Hello !

I’m sure you know this, but as SDL is LGPL, anything you link
statically and release must be licenced as LGPL or GPL.

But SDL 1.3/2.0 is dual licensed which allows static linking,
without releasing source code.

CU

No. You literally provide:

somegame.exe – your game, and all the libs needed (SDL, etc.),
statically-linked

somegame.o – your game, just the object file
(which can then be statically-linked with the libs needed
to generate an updated EXE using newer libs)

This allows you to release a proprietary application, while still
utilizing LGPL libraries, and therefore providing your users the
freedom that the authors of the LGPL’d libraries intended the users to have.On Tue, Jun 24, 2008 at 07:57:39PM +0100, Edward Cullen wrote:

Hehe,

Me either.

I think what you’re suggesting is a thin wrapper that you link
statically into your code, but is linked dynamically to SDL?


-bill!
“Tux Paint” - free children’s drawing software for Windows / Mac OS X / Linux!
Download it today! http://www.tuxpaint.org/

I’m sure you know this, but as SDL is LGPL, anything you link
statically and release must be licenced as LGPL or GPL.

But SDL 1.3/2.0 is dual licensed which allows static linking,
without releasing source code.

If you buy a license, that is.On Tue, Jun 24, 2008 at 2:58 PM, Torsten Giebl wrote:


http://pphaneuf.livejournal.com/

Ah…

I see.

I stand corrected.

Eddy

Bill Kendrick wrote:> On Tue, Jun 24, 2008 at 07:57:39PM +0100, Edward Cullen wrote:

Hehe,

Me either.

I think what you’re suggesting is a thin wrapper that you link
statically into your code, but is linked dynamically to SDL?

No. You literally provide:

somegame.exe – your game, and all the libs needed (SDL, etc.),
statically-linked

somegame.o – your game, just the object file
(which can then be statically-linked with the libs needed
to generate an updated EXE using newer libs)

This allows you to release a proprietary application, while still
utilizing LGPL libraries, and therefore providing your users the
freedom that the authors of the LGPL’d libraries intended the users to have.

Hello,

It is not the time overhead, but the storage space: even for really
tiny applications, you have to include megabytes of dlls when using
images, audio, etc.

Z.On Jun 24, 2008, at 8:57 PM, Edward Cullen wrote:

In other words; don’t link statically unless you’re on an embedded
platform that either doesn’t support dynamic linking or you need
to save the overhead of dynamic linking (which ONLY applies to
embedded platforms).
-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2210 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080625/df21323c/attachment.bin