[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: portability of ncurses
From: |
Thomas Dickey |
Subject: |
Re: portability of ncurses |
Date: |
Wed, 23 Nov 2005 10:23:29 -0500 (EST) |
On Wed, 23 Nov 2005, Rajat Das wrote:
Hi Thomas,
I was reading the Linux Standard Base book and they say that one should
use curses.h instead of ncurses.h for portability reasons.
http://lsbbook.gforge.freestandards.org/dont.html
Well, some of what the LSB people say is incorrect. But this happens to be
correct, though not for the reason that the LSB implies. A standard
install of ncurses would always install a symbolic link ncurses.h (and
what the LSB doesn't mention is that some packagers modify that and other
details, thereby creating problems for developers).
The real portability issue isn't between dialects of Linux, but
portability to other platforms.
The standard way to include curses headers is
#include <curses.h>
Some applications are written to use one of these, for various reasons:
#include <ncurses.h>
#include <ncurses/curses.h>
#include <ncurses/ncurses.h>
For platforms where ncurses is not the "system" curses implementation,
my recommendation is to install ncurses with the --disable-overwrite
option and use
#include <ncurses/curses.h>
It is also possible to set the compiler -I flags to allow
#include <curses.h>
if the header is "really" something like
/usr/local/include/ncurses/curses.h
but that may rely on the compiler's behavior to a greater degree than
the former.
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net