delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/03/18/13:32:16

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: mehen.visi.com: www set sender to mbresnah AT visi DOT com using -f
Message-ID: <1048012319.3e77661fae5e5@my.visi.com>
Date: Tue, 18 Mar 2003 12:31:59 -0600
From: mbresnah AT visi DOT com
To: cygwin AT cygwin DOT com
Subject: Re: Building a .exe w/ no cygwin1.dll dependancy...
References: <F105eTxtfkdpczeyifM00002862 AT hotmail DOT com>
In-Reply-To: <F105eTxtfkdpczeyifM00002862@hotmail.com>
MIME-Version: 1.0
User-Agent: Internet Messaging Program (IMP) 4.0-cvs
X-Originating-IP: 169.155.33.1

Does -mno-cygwin satisfy your needs?  See the cygwin user manual.

Mike
Quoting Tim Renner <l0ci AT hotmail DOT com>:

> Does anybody know how to do this?  I've tried building my test program a
> couple different ways
> 
> g++ -o pipetest pipetest.cc /usr/lib/libcygwin.a
> g++ -o pipetest pipetest.cc -lcygwin
> 
> g++ -static -o pipetest pipetest.cc
> g++ -static -o pipetest pipetest.cc -lcygwin
> 
> And no matter what, the resulting executable still depends on cygwin1.dll.
> 
> I would very much prefer not to have to force a completely static build
> because I would like to allow the loading of shared libraries...  I just
> want the C-runtime library provided by cygwin to be statically linked so
> there is no dependancy on the .dll.  Here's my quick test program if anyone
> would like to play with it...
> 
> Thanks,
> -Tim
> 
> -----------------------------------------------------------
> #include <string>
> #include <stdio.h>
> 
> int main()
> {
>         std::string cmd = "ls -l";
>         FILE* pipe = popen(cmd.c_str(),"r");
> 
>         do {
>                 char buffer[1024];
> 
>                 fgets(buffer, 1024, pipe);
>                 cout << "Text: " << buffer << flush;
>         } while (! feof(pipe));
>         cout << endl;
> 
>         pclose(pipe);
>         return 0;
> }
> 
> -----------------------------------------------------------
> 
> 
> _________________________________________________________________
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
> 
> 
> --
> 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/

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019