This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: compile ncurses "hello world" to run independent of cygwin?
- From: cyg Simple <cygsimple at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 2 Nov 2015 07:42:36 -0500
- Subject: Re: compile ncurses "hello world" to run independent of cygwin?
- Authentication-results: sourceware.org; auth=none
- References: <5636D2C5 dot 6020309 at ehdp dot com>
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