Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error while loading shared libraries: libpoppler.so.58: cannot open shared object file

I compiled and install poppler-0.39.0 as per the instruction. By default header files went int \usr\local\include and lib files went into \usr\local\lib. pdftohtml is installed in \usr\local\bin.

Now when I tried to run pdftohtml it gives following error.

pdftohtml: error while loading shared libraries: libpoppler.so.58: cannot open shared object file: No such file or directory. 

Though libpoppler.so.58 is present in \usr\local\lib. Please help me.

like image 495
user1428258 Avatar asked Feb 02 '16 11:02

user1428258


2 Answers

I had a similar problem on Ubuntu 18.04. After installation I got this error:

error while loading shared libraries: libpoppler.so.90: cannot open shared object file: No such file or directory

It turned out it was installed to /usr/local/lib:

Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/lib/libpoppler.so.90.0.0
-- Installing: /usr/local/lib/libpoppler.so.90
-- Installing: /usr/local/lib/libpoppler.so
-- Installing: /usr/local/lib/pkgconfig/poppler.pc
-- Installing: /usr/local/lib/pkgconfig/poppler-splash.pc
-- Installing: /usr/local/lib/pkgconfig/poppler-qt5.pc
-- Installing: /usr/local/lib/pkgconfig/poppler-glib.pc
-- Installing: /usr/local/lib/pkgconfig/poppler-cairo.pc
-- Installing: /usr/local/lib/pkgconfig/poppler-cpp.pc

but the system wasn't looking there.

To check if /usr/local/lib is in the default directories to search you can take a look at /etc/ld.so.conf.d/libc.conf.

If not already there you can add: /usr/local/lib

In my case this was already the case:

# libc default configuration
/usr/local/lib

But the cache at /etc/ld.so.cache wasn't updated.

To do so run (as root / sudo):

ldconfig

Solved the problem for me. Hope this may be helpful for someone!

like image 114
MBT Avatar answered Oct 14 '22 23:10

MBT


Just had this very same error message displayed in an Amazon Linux 64 bits box. I guess pdftotext was looking for libpoppler.so.58 inside /usr/lib64/ but the lib was located on /usr/lib

So i ran the following commands (as superuser):

$ cp /usr/lib/libpoppler.so.58.0.0 /usr/lib64

$ ldconfig

You may have to replace directories to make that fit your case. I'm not sure if it's the most correct workaround but it worked.

like image 37
André Luiz Avatar answered Oct 14 '22 22:10

André Luiz