From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14981 invoked by alias); 21 Jun 2017 21:49:07 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 14949 invoked by uid 89); 21 Jun 2017 21:49:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA,FREEMAIL_FROM,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*UA:en-US, H*r:Unknown, clue X-HELO: blaine.gmane.org Received: from Unknown (HELO blaine.gmane.org) (195.159.176.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Jun 2017 21:49:05 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dNnUf-0002KU-7I for cygwin@cygwin.com; Wed, 21 Jun 2017 23:48:57 +0200 To: cygwin@cygwin.com From: =?UTF-8?Q?Ren=c3=a9_Berber?= Subject: Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd Date: Wed, 21 Jun 2017 21:49:00 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Lightning/0.9 Thunderbird/2.0.0.19 Mnenhy/0.7.6.0 In-Reply-To: X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00260.txt.bz2 On 6/21/2017 4:10 PM, Wouter van Doorn wrote: > Having installed Cygwin with no errors I could see, I went on to > compile and run "hello world" - as you do. I could make it go from a > windows command prompt after modifying the system path to include > cygwin\bin, so - so far so good. > > From the cygwin terminal, however, the same executable refuses to play > ball. No text is shown; the command prompt returns instantly. [snip] It could be the program itself, i.e. not coded for a Posix environment, or it could be your PATH which should include /usr/bin (as shown, not as a Windows path C:\...) Easiest way to figure it out is by running: $ ldd hello (or whatever the name of your executable is) (sample output) ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffaf6600000) ??? => ??? (0x77790000) wow64.dll => /cygdrive/c/WINDOWS/System32/wow64.dll (0x5aa40000) wow64win.dll => /cygdrive/c/WINDOWS/System32/wow64win.dll (0x5aaa0000) In this case the missing cygwin1.dll doesn't even show its name, it happens to be the 32-bit version, because I ran ldd from a 64-bit Cygwin on a 32-bit Cygwin program, my PATH doesn't include the cygwin 32-bit binary directory. And if that doesn't show the missing libraries, then even $ file hello could show a clue, like "PE32+ executable (GUI) x86-64 (stripped to external PDB), for MS Windows" which is a GUI program compiled with MinGW, i.e. doesn't depend on Cygwin. Cygwin is not mentioned in the output of file, even a Cygwin console program shows something like "PE32 executable (console) Intel 80386, for MS Windows" or "PE32+ executable (console) x86-64, for MS Windows". Hope this helps. -- R. Berber -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple