[SOLVED] Compiling Calcurse with error "Can't find ncurses", but it's there

#1

Hello.
I wanted to compile the nice tool “calcurse”, just to try on my Linux Mint 19.
First problem I faced was an outdated C library, so I installed libc6-dev which went fine.
The Website suggested to have ncurses installed, so I got it and compiled it, because the version in the repos is older (5.x).

wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz
$ tar xzf ncurses-6.1.tar.gz
$ cd ncurses-6.1
$ ./configure --prefix=/opt/ncurses
$ make
# make install

Then checked with

$ ls -la /opt/ncurses
insgesamt 24
drwxr-xr-x 6 root root 4096 Dez 22 22:47 .
drwxr-xr-x 3 root root 4096 Dez 22 22:46 ..
drwxr-xr-x 2 root root 4096 Dez 22 22:47 bin
drwxr-xr-x 3 root root 4096 Dez 22 22:47 include
drwxr-xr-x 2 root root 4096 Dez 22 22:47 lib
drwxr-xr-x 5 root root 4096 Dez 22 22:47 share

But after that the configure script was not able to find ncurses:

checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking whether make supports nested variables… yes
checking whether NLS is requested… yes
checking for msgfmt… /usr/bin/msgfmt
checking for gmsgfmt… /usr/bin/msgfmt
checking for xgettext… /usr/bin/xgettext
checking for msgmerge… /usr/bin/msgmerge
checking for style of include used by make… GNU
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking whether gcc understands -c and -o together… yes
checking dependency style of gcc… gcc3
checking build system type… x86_64-pc-linux-gnu
checking host system type… x86_64-pc-linux-gnu
checking for ld used by GCC… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for shared library run path origin… done
checking whether NLS is requested… yes
checking for GNU gettext in libc… yes
checking whether to use NLS… yes
checking where the gettext function comes from… libc
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ISO C89… (cached) none needed
checking whether gcc understands -c and -o together… (cached) yes
checking dependency style of gcc… (cached) gcc3
checking how to run the C preprocessor… gcc -E
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking ctype.h usability… yes
checking ctype.h presence… yes
checking for ctype.h… yes
checking getopt.h usability… yes
checking getopt.h presence… yes
checking for getopt.h… yes
checking locale.h usability… yes
checking locale.h presence… yes
checking for locale.h… yes
checking math.h usability… yes
checking math.h presence… yes
checking for math.h… yes
checking signal.h usability… yes
checking signal.h presence… yes
checking for signal.h… yes
checking stdio.h usability… yes
checking stdio.h presence… yes
checking for stdio.h… yes
checking for stdlib.h… (cached) yes
checking for string.h… (cached) yes
checking for sys/stat.h… (cached) yes
checking for sys/types.h… (cached) yes
checking sys/wait.h usability… yes
checking sys/wait.h presence… yes
checking for sys/wait.h… yes
checking time.h usability… yes
checking time.h presence… yes
checking for time.h… yes
checking for unistd.h… (cached) yes
checking fcntl.h usability… yes
checking fcntl.h presence… yes
checking for fcntl.h… yes
checking paths.h usability… yes
checking paths.h presence… yes
checking for paths.h… yes
checking errno.h usability… yes
checking errno.h presence… yes
checking for errno.h… yes
checking limits.h usability… yes
checking limits.h presence… yes
checking for limits.h… yes
checking regex.h usability… yes
checking regex.h presence… yes
checking for regex.h… yes
checking for initscr… no
checking for initscr in -lncursesw… no
checking for initscr in -lncurses… no
configure: error: Either ncurses or ncursesw library is required to build calcurse!

After a quick search it was suggested to give the configure script the location of ncurses to include:

./configure --includedir=/opt/ncurses/include

But that didn’t work.
Now I’m stuck at this stage.
Maybe there’s only one small tweak to do, that I don’t see yet and someone could give me a hint.

Thanks and have a merry christmas.

1 Like

#2

That’s the right track. I don’t know the configure options well, but I think there should be an option to specifically choose the ncurses you want, which means you should be able to choose the folder where ncurses is installed. I don’t know if the --includedir option is enough for that or if there is another or better one specifically to choose specific ncurses. Maybe you also just need to add /opt/ncurses/bin to your PATH or you add this folder to --includedir option. Try out something like that, that’s what I would suggest.

Okay, now I actually read the error. Try to include /opt/ncurses/lib or something like that. Because that’s where the libraries go.

1 Like

#3

Hello.
Thanks for your comment.
I just tried some hint I found over at askubuntu.
I set the environment variable:

export LDFLAGS=’-L/opt/ncurses/lib/’

Doesn’t work yet, but I get some other errors now:


checking for initscr… no
checking for initscr in -lncursesw… no
checking for initscr in -lncurses… yes
checking ncurses/ncurses.h usability… no
checking ncurses/ncurses.h presence… no
checking for ncurses/ncurses.h… no
checking ncurses.h usability… no
checking ncurses.h presence… no
checking for ncurses.h… no
configure: error: Missing ncurses header file

And then I set:

export CPPFLAGS=’-I/opt/ncurses/include/’

And voilá. It compiled.
Thanks for the help.

1 Like

#4

I just wanted to say thanks. I have been looking for a program like this for my Parrot Security distro and this fit the bill perfectly. Also, it was available through Parrots repos. Have a good one!

0 Likes

#5

My pleasure.
In Germany there’s a proverb saying “Zwei Fliegen mit einer Klappe schlagen”.
It translates to “Two birds with one stone”

A little bit harsh, but anyway… :wink:

0 Likes