2

I'm searching for a detailed step by step guide to add Ncurses to my project in Visual Studio 2017. I downloaded the source code, but I have no idea how to add it to my project. I know this question will be dumb for you, but I'm a beginner concerning C++ and do not find a tutorial online to add Ncurses to my project. I looked through the online documentation etc. but didn't find any helpful hint. I'm writing a console application.

I downloaded the code from: https://invisible-island.net/ncurses/#download_ncurses

Thank you for your help.


EDIT:

I know there is this solution:

#include <windows.h> 
void gotoxy( short x, short y ) 
{ 
    HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE) ; 
    COORD position = { x, y } ; 

    SetConsoleCursorPosition( hStdout, position ) ; 
}  

but I guess that's Windows specific. So what could I do instead which works for both: Unix/Windows.

Gino Pensuni
  • 356
  • 4
  • 15
  • From where did you download the source code? Please [edit] your question. – Jabberwocky Jan 22 '19 at 13:16
  • Following two links might help: https://stackoverflow.com/questions/11236908/add-curses-library-to-visual-studio-c and https://jdonaldmccarthy.wordpress.com/2014/09/05/how-to-set-up-pdcurses-in-visual-studio-2013-c/ – Jabberwocky Jan 22 '19 at 13:21
  • @Jabberwocky I already saw the first post, this doesn't help, to the second: the file I need to download (provided in the tutorial) is not found. I do not find the curses.h file in the folder I downloaded. I only find curses.p.h and curses.h.in – Gino Pensuni Jan 22 '19 at 13:28

1 Answers1

2

NCurses is UNIX library, i.e. available for POSIX UNIX-es like Linux, FreeBSD, MacOS X etc. There is PDCurses which support Windows, and you can replace ncurses with PDCurses in your program and use it with POSIX and another systems like DOS, Windows etc.

Please follow the PDCurses build manual. And check demos code

Victor Gubin
  • 2,782
  • 10
  • 24