Reputation: 93
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?
Upvotes: 8
Views: 22141
Reputation: 2194
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
from 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"
}
Upvotes: 6
Reputation: 675
I finally made it. First Build/Compile the Source according to docs.
make -f Makefile # did for me, Windows 10
Copy curses.h
and panel.h
into your include
folder. And, Copy wincon/pdcurses.a
into your lib
folder. Rename pdcurses.a
to libpdcurses.a
. (Because it's the standard).
Now, You can include curses.h
and compile it like this.
g++ main.cpp -lpdcurses
Upvotes: 2
Reputation: 163347
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.
Upvotes: 6