1.5.25-15: First steps with ncurses programming: can NOT build Hello_world app
Alexey Lyubimov
alexeipobox@yahoo.com
Fri Feb 27 13:53:00 GMT 2009
Hello,
I decided to learn HOWTO write applications with ncurses library, but my attempt failed during linking step (seems to me, that for some reason ld did not find stdscr).
OS: Win98SE
Source (tnc.c):
------------------------------------------------
#include <curses.h> /* -lncurses */
int
main(int argc, char** argv)
{
// Determine the terminal type and initialize curses data structures.
// The first function called should almost always be initscr().
initscr();
printw("Hello World!"); // write to an imaginary window (stdscr buffer)
refresh(); // dump the buffer contents on the screen
// Clean up after the curses routines. Anytime after the call to
// initscr(), endwin() should be called before exiting.
endwin();
}
------------------------------------------------
$ gcc -otnc -g tnc.c -lncurses
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.Info: resolving _stdscr by linking to __imp__stdscr (auto-import)
Notes:
1. Without refresh() call, the program builds and runs Ok (but, of course, nothing is shown on the "real" screen).
2. After adding refresh() call, I get the "auto-import" warning shown above, and again NOTHING is shown on the real screen during program run :-(
Can anybody explain me, where is my mistake?
--
Thank you.
Alexey Lyubimov
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygcheckout.txt
URL: <http://cygwin.com/pipermail/cygwin/attachments/20090227/fe0ba13a/attachment.txt>
-------------- next part --------------
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list