Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Tue, 17 Apr 2001 15:20:28 -0400 (EDT) From: Charles Wilson X-Sender: cwilson AT frontal DOT ibb DOT gatech DOT edu To: Felix Natter cc: cygwin AT cygwin DOT com Subject: Re: how to compile programs using (n)curses In-Reply-To: <87vgo5f3ti.fsf@mybaby.home.felix> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 16 Apr 2001, Felix Natter wrote: > > > when I try to compile a simple (n)curses program using cygwin, > > > I get lots of "undefined reference"-messages, one for each ncurses function, > > > but with a "impl_" prepended (i.e. impl_waddch). > > I read this, thanks. > But I compiled as you suggest. In fact, the problem also occurs if I > compile and link in one step: > I saved the following as test_curses.c: > #include > > int main(int argc, char** argv) > { > initscr(); > wclear(stdscr); > waddstr(stdscr, "hello world"); > wrefresh(stdscr); > getch(); > endwin(); > } > > gcc -static -DNCURSES_STATIC -o test_curses.exe test_curses > => undefined reference to endwin ... > gcc -o test_curses.exe test_curses.c > => undefined reference to _imp__endwin ... You do need to include the library! Add '-lncurses' (without the quotes) to the end of each command and it will work. > I looks like I have a broken installation. Maybe. But the problem above is caused by user error. --Chuck -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple