Compiling Midnight Commander -- what does provide stdscr

Hello everyone :-),

openSUSE Tumbleweed here, and I try to build mc from the sources. When I compile it against slang, no problem, but when I try to compile it against ncurses it fails at configure phase complaining about “stdscr” function, like this:

checking for library containing addwstr... -lncursesw
checking for library containing stdscr... no
configure: error: Cannot find a library providing stdscr

As you can see I have ncurses (devel) installed and it is recognized. No matter what version (5 or 6) I have I get the same error. The only lead I found (however it might be invalid) is the info, ncurses might be split into two packages, and “stdscr” sits in other one (tinfo). Howeve as far as I can see there is no such package (tinfo) available.

So how to build mc with ncurses support instead of slang?

Thank you very much in advance for the help.

Have you looked at the openSUSE build, I see no reference in the logs…

Check out the spec file and also lots of patches…

This patch looks related:

Thank you very much. I forgot to mention (sorry), I grabbed the source rpm from the repository (unpacked it because I needed to make some extra tests) and compiled it with to flavors – slang (this succeeded) and ncurses (this didn’t).

So this patch mc-fix_lib_search_path.patch is on the list and it is applied – actually it is the very first patch that is applied to the sources.

Anyway, as you can see ncurses is found, configure does not complain, only this function “stdscr” is not – so I wonder if there was a split indeed?

There are two different flavors of ncurses - libncurses5 and libncurses6. They are built from the same source but with different ABI (and library major version). libncurses6 is built with --enable-reentrant which changes some variable names, so stdscr becomes __nc_stdscr. You have two options

  1. Fix MC autoconfig checks. You will need to make sure proper includes are detected before and used in code looking for stdscr (so compiled program is using correct name). This is upstream issue and needs to be reported and fixed upstream.
  2. Use libncurses5 (and ncurses5-devel) to build your package as short term workaround.

Currently I tried ncurses 5 approach, but with the same result as ncurses 6. I am not sure if it is not because ncurses-devel for version 5 requires ncurses-devel for version 6 (sic!) so in effect when compiling mc I have both versions and maybe the active one is ncurses 6. And this is the reason the error is still the same.

I will try to change configure for mc next.