Discussion:
NCurses and Cygwin
Luis Vital
2010-05-17 18:06:15 UTC
Permalink
Hi,

I just installed NCurses under Cygwin.
Looking at the file list after the instalation I see that I have:

/usr/include/curses.h
/usr/include/ncurses.h
etc.

and

/usr/include/ncurses/curses.h
/usr/include/ncurses/ncurses.h
etc.

If I compile using #include <ncurses.h> I got errors but if I
compile using #include "ncurses/ncurses.h" I don't get errors and the
programs work fine.

Nevertheless all the examples use #include <ncurses.h> so this should
work fine.

Does anyone know why this is happening? Thanks in advance.
Best regards,

Luis Vital
Dave Korn
2010-05-17 18:35:47 UTC
Permalink
Post by Luis Vital
I just installed NCurses under Cygwin.
/usr/include/curses.h
/usr/include/ncurses.h
etc.
The real question is how these got there. They aren't part of any Cygwin
package. They must have been there already, for some reason. You should
probably just get rid of them.
Post by Luis Vital
/usr/include/ncurses/curses.h
/usr/include/ncurses/ncurses.h
etc.
If I compile using #include <ncurses.h> I got errors but if I
compile using #include "ncurses/ncurses.h" I don't get errors and the
programs work fine.
Nevertheless all the examples use #include <ncurses.h> so this should
work fine.
Add "-I /usr/include/ncurses" to your compile commands. I'm not sure why
the layout is a bit different between Cygwin and Linux, I guess it's just one
of those things. If you check the cygwin-specific docs for the package
(/usr/share/doc/Cygwin/ncurses.README), you'll see it says to use the -I option.

cheers,
DaveK
Steven Collins
2010-05-17 18:13:27 UTC
Permalink
Perhaps the examples are assuming you are controlling the include path
via a -I switch to the compiler, thus avoiding any direct reference in
the source code that would imply knowledge of your installation?

gcc -I /usr/include/ncurses ...
Post by Luis Vital
Hi,
I just installed NCurses under Cygwin.
/usr/include/curses.h
/usr/include/ncurses.h
etc.
and
/usr/include/ncurses/curses.h
/usr/include/ncurses/ncurses.h
etc.
If I compile using #include <ncurses.h> I got errors but if I
compile using #include "ncurses/ncurses.h" I don't get errors and the
programs work fine.
Nevertheless all the examples use #include <ncurses.h> so this should
work fine.
Does anyone know why this is happening? Thanks in advance.
Best regards,
Luis Vital
--
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
Vincent Rivière
2010-05-17 18:48:09 UTC
Permalink
Post by Steven Collins
Perhaps the examples are assuming you are controlling the include path
via a -I switch to the compiler, thus avoiding any direct reference in
the source code that would imply knowledge of your installation?
In older ncurses versions, ncurses.h was in /usr/include.
But now it is in the ncurses subdirectory.
So your example simply refer to the old version.
You just have to replace the includes to <ncurses/ncurses.h> and so on.
--
Vincent Rivière
rushojp
2010-05-19 06:04:50 UTC
Permalink
***@localhost /usr/include
$ for h in curses.h eti.h form.h menu.h ncurses.h panel.h term.h unctrl.h ; do
ln -s ncurses/$h $h ;done
I think libncurses-devel package should have these symlink files.

http://www.rpmseek.com/rpm-pl/libncurses-devel.html?hl=com&cs=libncurses-devel:PN:0:0:0:0:0
Hi,
I just installed NCurses under Cygwin.
/usr/include/curses.h
/usr/include/ncurses.h
etc.
and
/usr/include/ncurses/curses.h
/usr/include/ncurses/ncurses.h
etc.
If I compile using #include <ncurses.h> I got errors but if I
compile using #include "ncurses/ncurses.h" I don't get errors and the
programs work fine.
Nevertheless all the examples use #include <ncurses.h> so this should
work fine.
Does anyone know why this is happening? Thanks in advance.
Best regards,
Luis Vital
Charles Wilson
2010-05-19 12:27:45 UTC
Permalink
Post by rushojp
$ for h in curses.h eti.h form.h menu.h ncurses.h panel.h term.h unctrl.h ; do
ln -s ncurses/$h $h ;done
I think libncurses-devel package should have these symlink files.
Is anybody going to read the documentation? From
/usr/share/doc/Cygwin/ncurses.README:

...
========================================================================
All libraries (libncurses, libpanel, libmenu, libform, libncurses++)
come in both static (.a) and dynamic (.dll) forms. To link your project
with the C libraries:
#0) Use -I /usr/include/ncurses when compiling
...
Port Notes:
---------- ncurses-5.7-18 -- 20090102 -----------
* Remove symlinks in /usr/include/ to /usr/include/ncurses/*


The reasons the symlinks in /usr/include were removed was to treat
ncurses and ncursesw the same, rather than stamping one as the
"approved" version with "official" symlinks in /usr/include.

Actually, I'd prefer if people started using -I/usr/include/ncursesw and
linking against the wide version of the library instead.

--
Chuck

Loading...