8

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.

MBT
  • 21,733
  • 19
  • 84
  • 102
user1428258
  • 101
  • 1
  • 4

2 Answers2

12

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!

MBT
  • 21,733
  • 19
  • 84
  • 102
  • I had a similar problem with pdfgrep and libpopler.so.0. I wasn't able to check if the library of libpopler.so.0 was in the default directories but just running as sudo ldconfig was enough for me – Astrid A. Olave H. Apr 17 '20 at 00:23
  • 1
    That feeling when you find the fix to your problem only to realize you have been here before and already upvoted the question and correct answer. Thank you sir, I am sorry I have but only 1 upvote to give. – chrisan May 14 '20 at 15:03
1

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.

André Luiz
  • 193
  • 2
  • 10