Linking against ncurses, no package from Chocolately yet

I’m new to using the chocolatey package manager, I normally develop on Linux not Windows. I searched the choc site for the ncurses package but there weren’t any results for it. For testing a Windows build on Travis, is there any way that’s not yet documented that would allow me to build a C program and link against the ncurses library?

According to https://stackoverflow.com/questions/138153/is-ncurses-available-for-windows , ncurses is not available for Windows.

Hi @native-api,

That thread is pretty old. I’ve been able to install ncurses using the mingw package manager on Windows. Would that be possible on Travis? Is only the mingw compiler supported, not the package manager?

Obsolescence note: the builder image has been updated since this was written. A newer snapshot can be found at Windows builder snapshot 1809.


Oh, you mean mingw. It’s not quite “Windows”.

I’ve got a snapshot of the Windows Builder directory structure and environment (as seen from Git Bash) with the following test .yml:

os: windows
language: shell

script:
    - find /c | gzip >disk.txt.gz
    - set >env.txt
    - curl -T "{disk.txt.gz,env.txt}" ftp://<user>:<passwd>@<your_ftp_server>/

It shows that there’s no mingw-get or pacman but there’s /c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/opt/include/ncursesw/ncurses.h.

So you should probably be able to #include <ncurses.h>, likely with adding a -I.

1 Like

Thanks. Do you know the location of the library? Right now cmake fails when using the FindCurses module. I’ll try manually adding the include path after I know the location of the library.

In the same file on the link,

/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/opt/lib/libncurses++w.a
/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/opt/lib/libncurses++w_g.a
/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/opt/lib/libncurses.a
/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/opt/lib/libncursesw.a
/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/opt/lib/libncursesw_g.a

dunno which of them. Probably depends on compiler switches.