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]

1.5.25-15: First steps with ncurses programming: can NOT build Hello_world app

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 */

main(int argc, char** argv)
  // Determine the terminal type and initialize curses data structures.
  // The first function called should almost always be 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.

$ 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)

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


Attachment: cygcheckout.txt
Description: Text document

Unsubscribe info:
Problem reports:

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