[ale] Compiling ssh

Joseph A. Knapka jknapka at earthlink.net
Thu Dec 28 16:26:49 EST 2000


> 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.





More information about the Ale mailing list