[maemo-developers] Static and dynamic linkage

From: Guillem Jover guillem.jover at nokia.com
Date: Thu Nov 29 16:20:42 EET 2007
On Wed, 2007-11-28 at 10:19:17 +0200, ext Eero Tamminen wrote:
> maemo at bitblit.net wrote:
> > Is there a standard way to ask for a specific library to be linked in 
> > statically and the rest to be dynamic?
> Just specify the static library you want to link with:
> 	gcc -o test -lsomedynamiclib my-static-libs/foobar.a

Better do something like:

  $ gcc -o test \
      -lsomedynamiclib \
      -Wl,-Bstatic -lsomestaticlib -Wl,-Bdynamic \
      -lsomeotherdynamiclib \

> > Specifically, I want to statically link in the SQLite library but leave 
> > the rest of the linkage as is.

I'd say better not to statically link at all.


More information about the maemo-developers mailing list