PDCurses is a text-based user interface library that provides an API compatible with ncurses.
With PDCurses it is possible to develop TUI applications regardless of the platform. It is designed to be used on a variety of operating systems, including Windows, DOS, OS/2, and Unix-like .com/tags#unix).
First of all, you need to have the following tools installed on your Windows:
Remember to rename the
mingw32-make
file tomake
only, in path:C:\mingw64\bin\mingw32-make
(.exe
) toC:\mingw64\bin\make
(.exe
).
After all dependencies are satisfied, now let’s clone, compile and install the PDCurses library.
Open Windows Terminal or PowerShell or even CMD
and follow the steps.
Tip: The ideal thing to do after opening one of these applications is to enter the Desktop, as we will be sure there will be no permission problems:
wincon
subfoldermake
commandAs renamed as it can be mingw32-make
if you haven’t done so!
After the compilation is complete, you can still find PDCurses\wincon
in: Windows Terminal, PowerShell or CMD. Copy the files to subfolders of C:\mingw64
:
Copy the PDCurses static library, run this command:
And also copy the header, but first exit the wincon
folder:
If you wanted, you can even delete the cloned repository: PDCurses\
.
Hello, World!
Having done all the steps correctly, now create a file named main.cpp
, or whatever name you prefer in a location you can create (example: on the Desktop) and insert this content:
To compile, run this command:
Indicating the folder path where to find the
curses.h
file and compile it together with thepdcurses.a
file, in some cases it is possible to use only the flag:-lpdcurses
, but I believe that in your case it won’t work.
Once compiled, now just run the binary: a.exe
or if you are using PowerShell:
All terminal content will be cleared and the message will appear. Pressing any key will exit this message and return to the terminal!
For more information about PDCurses I recommend accessing the address: https://github.com/wmcbrine/PDCurses.
windows ncurses tui cpp clanguage