First install the full package of Cygwin, the package has a size of 7GB or so
Then use this small example to test whether the success
#include <ncurses.h> #include <string> #include <vector>//#define DEBUG#IFDEF Debug#include < Iostream> #include <cstdio> #endifint main (void) { int x, y; std::vector<std::string> msg; Msg.push_back ("Hello ncurses!"); Msg.push_back ("Please Enter AnyKey to exit ..."); Std::vector<std::string>::iterator Pa=msg.begin (); #ifndef DEBUG initscr (); Curs_set (0); NoEcho (); Getmaxyx (stdscr,y,x); Refresh (); MVPRINTW (Y/2,x/2-pa->size ()/2,pa->c_str ()); for (int i=0;pa!=msg.end (); ++pa,++i) mvprintw (Y/2+i,x/2-pa->size ()/2,pa->c_str ()); Refresh (); Getch (); Echo (); Curs_set (1); Endwin (); #else printf ("%s\n", (++PA)->c_str ()); std::cout<<*pa<<std::endl; #endif return 0;}
The compilation directives are:
You can see that the compilation was successful.
Using the ncurses library in Cygwin