Unable to link library Libtermcap with g++


I’ve install Termcap with help of zypper as you can see below

zypper info termcap

Loading repository data…
Reading installed packages…

Information for package termcap:

Repository : Main Repository (OSS)
Name : termcap
Version : 2.0.8-1045.2
Arch : x86_64
Vendor : openSUSE
Installed Size : 610.5 KiB
Installed : Yes
Status : up-to-date
Source package : termcap-2.0.8-1045.2.src
Summary : The Termcap Library
Description :
The termcap library.

I see the library in /usr/lib64

but when i try to link that library i get:
patrick@linux-wzyg:~/projects/gnucap/gnucap/lib> g++ test_readline.cc -lreadline -ltermcap
/usr/lib64/gcc/x86_64-suse-linux/8/…/…/…/…/x86_64-suse-linux/bin/ld: cannot find -ltermcap
collect2: error: ld returned 1 exit status

I don’t understand how it is different from eg. readline

thanks for your help

>rpm -ql termcap shows


So it installs libtermcap.so to /usr/lib64/termcap , which isn’t in the default searchpath of ld. You will need to add a -L/usr/lib64/termcap to the compiler/linker flags.

IIRC libtermcap.so is hidden in that subdirectory because using libtermcap is considered to be deprecated and it is recommended to use ncurses instead.

thanks. ir works with that directory.
nice to learn on the rpm query command.
i was confused as I saw termcap.so.2 in the root folder