8

我按照说明编译并安装了 poppler-0.39.0。默认情况下,头文件进入 int\usr\local\include并且 lib 文件进入\usr\local\lib. pdftohtml 安装在\usr\local\bin.

现在,当我尝试运行时pdftohtml,它会出现以下错误。

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

虽然libpoppler.so.58存在于\usr\local\lib. 请帮我。

4

2 回答 2

10

我在 Ubuntu 18.04 上遇到了类似的问题。安装后我收到此错误:

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

原来它被安装到/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

但系统不在那里。

要检查是否/usr/local/lib在要搜索的默认目录中,您可以查看/etc/ld.so.conf.d/libc.conf.

如果还没有,您可以添加:/usr/local/lib

就我而言,情况已经如此:

# libc default configuration
/usr/local/lib

但是缓存/etc/ld.so.cache没有更新。

为此运行(作为root/ sudo

ldconfig

为我解决了这个问题。希望这可能对某人有所帮助!

于 2019-09-03T10:07:54.483 回答
1

刚刚在 Amazon Linux 64 位框中显示了同样的错误消息。我猜 pdftotext 正在 /usr/lib64/ 内寻找 libpoppler.so.58 但该库位于 /usr/lib

所以我运行了以下命令(作为超级用户):

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

$ ldconfig

您可能必须替换目录以使其适合您的情况。我不确定这是否是最正确的解决方法,但它确实有效。

于 2016-08-03T20:16:19.110 回答