Reputation: 570
I recently went to try to debug a program with GDB and got the following error:
gdb: error while loading shared libraries: libncursesw.so.6: cannot open shared object file: No such file or directory
So I went investigating and tried the obvious things, ie sudo apt-get install libncursesw5
(and dev variants) and apt reports that I've already got the latest version...so next I tried reinstalling GDB, problem persists. The output of ldd with GDB confirms to me that it still doesn't know where this mythical libncursesw.so.6
file is, so I go digging around in the usr/lib/x86_64-linux-gnu
folder and run ls libncu*
which returns six results: libncurses.a
, libncurses++.a
, libncurses.so
, libncurses++w.a
, libncursesw.a
, and libncursesw.so
...but no libncursesw.so.6
. I then naively attempted to just make a copy of libncursesw.so
named libncursesw.so.6
, to which gdb reports that this file is "too short".
In googling I can't seem to find a good explanation on how to get this file in place? Every other answer I see just suggests running sudo apt-get install libncursesw5
(or something similar) but I've already tried pretty much every variant of that I can think of. I was going to remove it and then reinstall it but when I went to do that it gave me a scary warning that I could be doing something potentially harmful to my system so I aborted that idea.
Some context that also might(?) help: I'm running a pretty recent install of Linux Mint 19.3 Cinnamon, and this was my first time trying to run GDB on my new computer. I basically set this new computer up as a new install, just porting over my home directory and a couple of the more useful hidden . files from my old laptop...I figure this shouldn't be the reason GDB is failing/these files don't exist on the new machine but just in case I'm mentioning it.
Upvotes: 5
Views: 17898
Reputation: 213526
obvious things, ie
sudo apt-get install libncursesw5
You want libncursesw6
, not libncursesw5
.
Upvotes: 6