delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/11/02/07:42:48

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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=SPp1BSTUJ48vRBBX
1sWYbCPGVkvURJBHb+BXUCbPaefy2lXFbUGPA7Xf4HHhm3MWAh/0CAuJ1QKvnt4/
SOCSdNLcNX6UtMZYg00LOC2eimKgOc74TAxZVopp6LPXAGk7bVwWUxa+/L0aVYFm
DSxfGxW/RgspcQggjOPGcXZTjtk=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=OAjxEkTsZQqfyzjNvuZJB5
Z6rnk=; b=iU9bhxG5BwXpmotnzllIWYDbojf5FCcO67TLqwB3NPC6QX59a7KaR8
O6VPZwu7NXgfN0S/r1KmEQ9gDsMKc5TDpEwFywif7YTLsmgR6mPIjY/M6WCtrk5u
Axf0LT4l2FeyCFRsPA031Kg1k/JAx7/qYR4nevnymQrV0zsWoImgM=
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.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-qk0-f180.google.com
X-Received: by 10.55.74.16 with SMTP id x16mr28888704qka.73.1446468147105; Mon, 02 Nov 2015 04:42:27 -0800 (PST)
Subject: Re: compile ncurses "hello world" to run independent of cygwin?
To: cygwin AT cygwin DOT com
References: <5636D2C5 DOT 6020309 AT ehdp DOT com>
From: cyg Simple <cygsimple AT gmail DOT com>
X-Enigmail-Draft-Status: N1110
Message-ID: <56375A3C.6020700@gmail.com>
Date: Mon, 2 Nov 2015 07:42:36 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <5636D2C5.6020309@ehdp.com>
X-IsSubscribed: yes

On 11/1/2015 10:04 PM, Daniel Goldman wrote:
> 
> $ gcc ncurses-1.c -lncurses
> 
> $ ./a.exe # runs perfectly under cygwin
> 

A Cygwin build using the Cygwin runtime should work.

> $ i686-pc-mingw32-gcc -I /usr/include ncurses-1.c -L /lib -lncurses
> 
> $ ./a.exe
> Segmentation fault
> 

A MinGW build using the Cygwin runtime should *never* work.

> 
> What am I doing wrong? How do I use cygwin to compile the test ncurses
> program so it can run in a dos terminal, independent of cygwin? I looked
> around the docs and archives and could not figure out.
> 

You need to specify include and lib paths that contain MinGW libraries.
 Don't use the Cygwin native paths of /usr/include and /lib.  This means
that you need a ncurses library that is built with MinGW.

-- 
cyg Simple

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