NCurses
Dave Korn
dave.korn.cygwin@gmail.com
Mon May 17 15:46:00 GMT 2010
On 17/05/2010 15:50, Luis Vital wrote:
> Hi Dave,
>
> I appologise for comming back to you but I am experiencing some problems
> with NCurses under Cygwin.
Hi Luis,
Please keep the discussion on the list, for all the reasons described at
http://cygwin.com/acronyms/#PPIOSPE.
> As they say on the documentation I wrote this program:
>
> #include <ncurses.h>
> int main()
> {
> initscr(); /* Start curses mode */
> printw("Hello World !!!"); /* Print Hello World */
> refresh(); /* Print it on to the real screen */
> getch(); /* Wait for user input */
> endwin(); /* End curses mode */
>
> return 0;
> }
>
> I compile it with: gcc Hello.c -lncurses
>
> But I got the folowing error messages:
>
> /tmp/ccnsdh1e.o:Hello.c:(.text+0x3c): undefined reference to `_stdscr'
> /tmp/ccnsdh1e.o:Hello.c:(.text+0x49): undefined reference to `_stdscr'
That's peculiar, it shouldn't have worked at all. The "ncurses.h" file
doesn't live in /usr/include directly, but in a subdir called
/usr/include/ncurses, so with your #include statement as you have it there, I get:
> $ gcc h.c -lncurses
> h.c:1:21: error: ncurses.h: No such file or directory
when I try to compile your example. If I change the example to #include
"ncurses/ncurses.h", I get a fully working compile.
It seems possible you have a bogus ncurses.h in your /usr/include, for some
reason? You should make sure you have installed the regular cygwin
libncurses-devel package (using setup.exe) to get the ncurses headers and link
libraries (maybe you should try reinstalling it even if you do already have it).
cheers,
DaveK
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list