This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Statically linking programs??
- To: Mark Paulus <commpg at yahoo dot com>
- Subject: Re: Statically linking programs??
- From: "Charles S. Wilson" <cwilson at ece dot gatech dot edu>
- Date: Thu, 29 Mar 2001 20:18:53 -0500
- CC: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- References: <200103292359.f2TNx5e11276@mail.ee.gatech.edu>
Mark Paulus wrote:
>
> I was looking through the FAQ, and I see about an option to
> build binaries that link either the cygwin or the Micro$oft
> dlls. However, I do not see an option to build statically linked
> binaries that require no dlls. Is this a possibility??
Not under windows. All windows programs require a runtime library of
some sort (like "glibc" on linux). On the windows platform, all of the
available runtime libraries are dynamic libs (dlls). This includes:
msvcrt.dll (microsoft runtime)
crt.dll (older microsoft runtime)
cygwin1.dll (cygwin runtime)
>
> (-static doesn't seem to have any effect:
> man gcc:
> -static
> On systems that support dynamic linking, this pre-
> vents linking with the shared libraries. On other
> systems, this option has no effect.
> )
Incorrect. "-static" causes the linker to *prefer* static libs over
dynamic libs, but if there is only a dynamic lib then the linker goes
ahead and uses it rather than bail out and fail. In the case of runtime
libraries, there are only dll's -- so you will always dynamically link
to one of the runtimes.
--Chuck
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple