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


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


      

Attachment: cygcheckout.txt
Description: Text document

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

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