Error installing Curses from CPAN

I am having problems installing the Curses perl library from CPAN. I have been installing this on various versions of MacOS since 2001 with little or no problems. Now I'm trying to install it on Monterey (12.5), and I'm not making much progress. The main problem seems to be that curses.h is not found during the compile step and -lcurses is not found during the load step.

On my 10.14.6 system where everything works, the header file is in

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/curses.h

and the loader stub file is in

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libcurses.tbd

That stub file points to /usr/lib/libncurses.5.4.dylib, which I can verify does exist.

However, on my 12.5 system, the header and the stub files exist, but the actual *dylib file is not there.

I originally had these problems when I had only the command line tools installed on the 12.5 system. I have subsequently downloaded the full Xcode (about 30GB!!!), thinking that might fill in the missing pieces, but I still get the same errors. I presume that I have done something wrong during the command line tools install or during the full Xcode install, or maybe I need some environment variables to be set appropriately. Or maybe I need to somehow tell Xcode to download and install that *dylib file?

I have never had to debug this before, so I don't really know how the CPAN install process works, despite using it for 20 years. In the past, it has always just worked with minimal effort.

Has anyone else had this problem and know the solution?

With the help of Bryan Henderson who is the maintainer of the CPAN Curses module, this has been resolved. The problem is that the CPAN install process cannot locate the curses system library, so it does not property configure the Makefile that is constructed. The workaround (for the current version 1.39) is the following:

`export CURSES_LDFLAGS=''

export CURSES_CFLAGS='-lncurses'

perl Makefile.PL

make LDLOADLIBS=-lncurses

make LDLOADLIBS=-lncurses install

make LDLOADLIBS=-lncurses cdemo`

Error installing Curses from CPAN
 
 
Q