Re: static linking with glib



On Mon, 27 Jan 2003, Alexander Varakin wrote:

> How?

Good question :-)

Different methods I can think of:

1) Don't compile shared library if you don't have glib installed.

2) Make a directory, put a link to libglib.a there and add the directory
to LDFLAGS:

mkdir staticlibs
ln -s /usr/lib/libglib.a staticlibs/
make LDFLAGS=-L`pwd`/staticlibs
rm -rf staticlibs

3) Instruct the linker to pick the static library:
make GLIB_LIBS='-Wl,-Bstatic -lglib -Wl,-Bdynamic'

The same applies to all other libraries.

-- 
Regards,
Pavel Roskin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]