I see this message while running a program.
error while loading shared libraries: libprotobuf.so.7: cannot open shared object file:
How can I install libprotobuf.so.7?
I'm on ubuntu 20.04. I tried apt-file libprotobuf.so.7
but it gives me nothing. I tried sudo apt install libprotobuf7
or for libprotobuf-c
and it cannot locate the package.
How can I do that?
My OS version :
LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
ADD :
I found these files already installed in my system.
/usr/lib/x86_64-linux-gnu/libprotobuf.so.17
/usr/lib/x86_64-linux-gnu/libprotobuf.so
/usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0
so linked /usr/local/lib/libprotobuf.so.7
to /usr/lib/x86_64-linux-gnu/libprotobuf.so
. (/usr/local/lib2 is in
LD_LIBRARY_PATH`). But when I execute the program I see :
cm7_tarmac_decode: error while loading shared libraries: libprotobuf.so.7: wrong ELF class: ELFCLASS64
I figure this libprotobuf.so.17 is for x86_64 machine when the program (cm7_tarmac_decode) is looking for a 32 bit version.
so using apt-cache search protobuf
I thought libprotobuf17 is my package and because it should be for 32 bit , I tried sudo apt install libprotobuf17:i386
and it installed some files.
dpkg libprotobuf17:i386
shows these installed files.
/usr
/usr/lib
/usr/lib/i386-linux-gnu
/usr/lib/i386-linux-gnu/libprotobuf.so.17.0.0
/usr/share
/usr/share/doc
/usr/share/doc/libprotobuf17
/usr/share/doc/libprotobuf17/changelog.Debian.gz
/usr/share/doc/libprotobuf17/copyright
/usr/lib/i386-linux-gnu/libprotobuf.so.17
So under /usr/lib32, I did
/usr/lib32$ sudo ln -s /usr/lib/i386-linux-gnu/libprotobuf.so.17 libprotobuf.so.7
(faking version 17 is version 7).
But when I excute the program I got this error message.
cm7_tarmac_decode: symbol lookup error: cm7_tarmac_decode: undefined symbol: _ZN6google8protobuf8internal12kEmptyStringE
This means the libprotobuf.so.17 doesn't have the symbol _ZN6google8protobuf8internal12kEmptyStringE
which is in real libprotobuf.so.7 file.
I tried sudo apt install libprotobuf7:i386
but there is no such package.
ADD2 :
see Tooster's answer below. but before seeing that answer, I received libprotobuf.so.7 file from my colleague and used it.