delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/06/21/17:49:30

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding
:in-reply-to; q=dns; s=default; b=WfarzmecvVwCshfGA1Rw/ZGRJ7jfPg
0Nevkhd5NupUqfNrJDd4QueYkVa83UtENm19ril0Jv0BccwmTO+MBEkn+QTYTYRj
XaPUH8UU8MyLcyOcXm0UlhPAj7WvsH4BTFONYdRoD5VgMl5saU7/+WlJVCKkvxei
3dO0bOic0+qbk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding
:in-reply-to; s=default; bh=ZcNHBnbfKf/EUfbNKEQPgarPYPk=; b=oFSO
kHUTnj0PUPHtU1XpVALy+hn56Kbpalky8F6ueHkYS4s8RqsisfRniC6wYeWHrdBv
s3o/Tlrx3ETleAX8Lk4UFrQoxktfuW8OG5FnozVuTp5KbLCNIyiPj6eqd9Uq1Dvu
dJozJ/3HSWwU5smN2ehT8+30Diep52PlJ1nuMpY=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
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
To: cygwin AT cygwin DOT com
From: =?UTF-8?Q?Ren=c3=a9_Berber?= <rene DOT berber AT gmail DOT com>
Subject: Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd
Date: Wed, 21 Jun 2017 16:48:18 -0500
Lines: 44
Message-ID: <oiepk2$78o$1@blaine.gmane.org>
References: <CANZ2p_ckjzWEp0uPoJ8MAXh=0B6ZhWQVt9v_NmsFP-fpoX-sEg AT mail DOT gmail DOT com>
Mime-Version: 1.0
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: <CANZ2p_ckjzWEp0uPoJ8MAXh=0B6ZhWQVt9v_NmsFP-fpoX-sEg@mail.gmail.com>
X-IsSubscribed: yes

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

- Raw text -


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