4

Running Doom Emacs 2.0.9 on Emacs 27.1 on Manjaro KDE.

When I compile a latex documents, it produces a PDF file and opens an emacs window to display it. But what is displayed is some text and not the PDF file.

The *Messages* buffer carries an error that says:

File mode specification error: (error Error running ‘/home/user/.emacs.d/.local/straight/build/pdf-tools/epdfinfo’: /home/user/.emacs.d/.local/straight/build/pdf-tools/epdfinfo: error while loading shared libraries: libpoppler.so.101: cannot open shared object file: No such file or directory

If that is of any use, this is happening after a massive update to the OS. Earlier, the new window would show the PDF file.

How do I correct this error?

3
  • Install the poppler library I guess? On Fedora, I do dnf install poppler poppler-dev but the names of the packages depend on the distribution, so you'll have to figure out what Manjaro calls them.
    – NickD
    Commented Sep 4, 2020 at 13:22
  • If you uninstall and re-install the pdf-tools package it should update its required packages for you.
    – rpluim
    Commented Sep 4, 2020 at 13:25
  • Or do M-: (pdf-tools-install nil nil nil t). The final t tells it to (re)-install system packages. Commented Sep 4, 2020 at 18:14

1 Answer 1

3

TL;DR

Go to path/to/.emacs.d/elpa/pdf-tools-xxx/build and run make clean to clean previously compiled contents manually.

Restart emacs and let it build pdf-tools. Then, pdf-tools works again :)


I have also met this problem.

Follow the error message, we can tell the problem is epdfinfo cannot find the library it wants, which is libpoppler.so.101.

After check the directory /usr/lib/ I found there is no libpoppler.so.101, instead, we get libpoppler.so.102. Then I checked the pamac history and found the poppler related packages were updated from 0.90.1-1 to 20.08.1-1. I think this is why libpoppler.so updated from 101 to 102.

The problem here is, after the update, pdf-tools tries to rebuild itself. However, it does not really do the rebuild, which I don't know why. (maybe make does not find the change of source code so it just skips all the rebuild. sorry, I only know little about compile.)

So, what I did is go to pdf-tools' directory which is path/to/.emacs.d/elpa/pdf-tools-xxx/build and run make clean to remove these object files manually. I also did make clean in the server subdirectory under build, but I am not sure if it is necessary. Then reopen emacs and let it rebuild the pdf-tools (or run pdf-tools-install, to rebuild it manually).

Now, pdf-tools works again.

Hope this can help.

4
  • There's no such path on my system. I use doom emacs.
    – soap
    Commented Jan 25, 2021 at 16:30
  • @Soap Sorry, I don't know where doom emacs put these files. However, have you tried the doom build command to ask doom to recompile all packages? Commented Jan 26, 2021 at 11:21
  • No, but uninstalling and installing pdf tools (by commenting and uncommenting the pdf line in init.el) worked! build may also have worked, I think
    – soap
    Commented Jan 26, 2021 at 14:19
  • 1
    Thank you, simply running pdf-tools-install and restarting Emacs solved it for me :)
    – xeruf
    Commented Jun 5, 2021 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.