I want to use it in some of my programs instead of the standard IOStream.
Also, does NCurses work on Windows, and if so, any better?
Download the zip file, unpack it wherever you typically put external libraries, and check the readme, which tells you the following:
PDCurses has been ported to DOS, OS/2, Win32, X11 and SDL. A directory containing the port-specific source files exists for each of these platforms. Build instructions are in the README file for each platform.
The readme file in the Win32 directory tells you that there are makefiles for several different compilers. In short, you run make
:
make -f makefilename
It tells mentions a couple of options you can set, including WIDE and UTF8.
To then use the library, add the directory that contains curses.h to your include path and link with the pdcurses.lib file that make
generates for you. How you modify your include path and your linked libraries depends on your development environment and is largely irrelevant to PDCurses.
Download PDCurses-master.zip and extract the content
Open\Run MSYS2 MinGW 64-bit
(or MSYS2 MinGW 32-bit
^1)
cd
into the wincon
folder and run make -f Makefile WIDE=Y DLL=Y
source
If you followed the steps above so far correctly, there should be 2 specific files inside wincon
folder called pdcurses.a
and pdcurses.dll
pdcurses.a
to libpdcurses.a
pdcurses.dll
into C:\msys64\mingw64\bin
libpdcurses.a
into C:\msys64\mingw64\lib
curses.h
and panel.h
form PDCurses-master
folder into C:\msys64\mingw64\include
Install the C/C++ extension
Follow those steps to create a working enviroment inside VSCode
Add "-lpdcurses"
under "args":
into tasks.json
and you are Done (at least those steps worked for me)
g++ your_example.c -o your_example -lpdcurses
inside MSYS2 MinGW 64-bit
terminal if you want so [...]{
"configurations": [
{
"name": "Win64",
"includePath": [
"${default}"
],
"windowsSdkVersion": "10.0.17763.0",
"compilerPath": "C:/msys64/mingw64/bin/g++.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "${default}"
}
],
"version": 4
}
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++.exe - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
}
]
}
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "C:\\msys64\\mingw64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"-lpdcurses"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With