PDCurses is a public domain implementation of the curses library for DOS, Win32, OS/2, X11 platforms. Installation procedure is given below.
1. Install latest GCC (>=v4.7.2). Download it from equation.com and follow the installation instructions. Let's say GCC is installed into
D:\gcc4.7.2
directory.2. Download
pdc34dllw.zip
or newer from sourceforge.net. For direct link click here.3. Extract
pdcurses.dll
to "D:\gcc4.7.2\libexec\gcc\i686-pc-mingw32\4.7.2"
directory.4. Extract
pdcurses.lib
to "D:\gcc4.7.2\i686-pc-mingw32\lib"
directory.5. Extract
curses.h
and panel.h
to "D:\gcc4.7.2\i686-pc-mingw32\include"
directory.6. Ensure that proper environment variables and path variables are set. The path must be added to the front of the other path variables so that it takes precedence.
EQ_LIBRARY_PATH
d:\gcc4.7.2\i686-pc-mingw32\lib
PATH7. Run the sample program to see if it prints "Hello World from PDCurses!" in the command prompt.
d:\gcc4.7.2\bin;
d:\gcc4.7.2\libexec\gcc\i686-pc-mingw32\4.7.2;
//hello.c8. To run the executable the
#include <curses.h>
int main() {
initscr(); // Start curses mode
printw("Hello World from PDCurses!"); // Print Hello World
refresh(); // Print it on to the real screen
getch(); // Wait for user input
endwin(); // End curses mode
return 0;
}
/* ---------------------------------------
> gcc -Wall -g -lpdcurses -o hello hello.c
> hello.exe
-----------------------------------------*/
pdcurses.dll
library is required. So if we are to bundle the app, ensure that the pdcurses.dll
file is also included along with the executable.9. Awesome! Now we have a working curses library.
To know more about ncurses see ncurses programming howto, Programmer's Guide to NCurses by Dan Gookin.