Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <001001c1e5cd$e95b5da0$e4bcfc3e@nori> From: "Sam Edge" To: References: Subject: Re: True Static Linking Date: Wed, 17 Apr 2002 06:07:57 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g3H590H15397 > (1) Is there a "-static" switch that statically links in cygwin1.dll? > (2) If not, how else can I solve this problem? I'm fairly new to Cygwin but from what I've picked up there is no static version of the cygwin library available either binary or source. This is a deliberate policy to try to ensure that all running Cygwin processes have the same version loaded and are all using the same shared memory and other kernel objects that are required to simulate the UNIX/POSIX API on top of the Win32 one. If your program really needs things like fork() or native Berkley sockets you could get the source for Cygwin and patch it to generate your own static version. I've no idea how difficult this might be and maintaining it with newer versions would be a headache. (It may be that a DLL is required by the Win32 architecture for some of the features.) I doubt whether a simple stand-alone executable needs this. The first thing to do is to try the "-mno-cygwin" switch on gcc as well as making everything else statically linked. You might get away with this providing you're not relying on Cygwin-specific API calls or C++ standard template libraries. (Make sure you've used SETUP.EXE to install the mingw-runtime and w32api packages first.) If that's not enough, you can go to http://www.colomsat.net.co/freehost/ngiraldo/cppcygwin.html to add the additional C++ STL. This has instructions for ensuring that you get what you need in a painless manner and can create native Win32 applications with the Cygwin GCC tool chain and all the other nice Cygwin (The other approach is to avoid using Cygwin as the development environment and to download the MinGW Win32-native GCC tols and libraries from http://www.mingw.org/, although this shouldn't be needed if you've configued everything correctly in Cygwin.) MinGW relies on the Micrsoft MSVCRTx.DLL run-time libraries but these are pretty much universal. There is in fact no such thing as completely static linkage under Windows since you always end up dynamically linking to SYSTEM32, USER32, GDI32 and/or other "universal" Win32 system DLLs. The VC runtime are pretty much in this category. -- Sam Edge -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/