[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Compiling ssh
- Subject: [ale] Compiling ssh
- From: jknapka at earthlink.net (Joseph A. Knapka)
- Date: Thu, 28 Dec 2000 14:26:49 -0700
> Chris Fowler wrote:
>
> I believe it is --staic. But does that link the whole library,
> including functions that are not used?
>
Only the necessary functions from the library will be linked into the
executable when linking statically. I believe that the --static
option tells GCC to link statically to all libraries, including
libc, so beware.
The easy way is to just explicitly specify an .so or a .a
depending on what you want done. On Linux, the linker (ld)
will accept both *.a and *.so files on the command line, which
means you can do:
gcc -o foo libfooUtils.a libfooDynamic.so foo.c
and get a "foo" executable that's dynamically linked to
libfooDynamic.so and statically linked to libfooUtils.a.
-- Joe Knapka
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.