This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compile ncurses "hello world" to run independent of cygwin?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]