Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

libQt5Core.so.5 not found error, even though it did find it. #4497

Closed
8176135 opened this issue Oct 9, 2019 · 3 comments
Closed

libQt5Core.so.5 not found error, even though it did find it. #4497

8176135 opened this issue Oct 9, 2019 · 3 comments

Comments

@8176135
Copy link

8176135 commented Oct 9, 2019

wkhtmltopdf version(s) affected: 0.12.5-1

OS information
WSL-Arch Linux

Description
Just by running it it complains

wkhtmltopdf: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory

However, I do have libQt5Core.so.5, this is the output from ls -al /usr/lib/libQt5Core*

-rw-r--r-- 1 root root    1166 Sep 10 03:48 /usr/lib/libQt5Core.prl
lrwxrwxrwx 1 root root      20 Sep 10 03:48 /usr/lib/libQt5Core.so -> libQt5Core.so.5.13.1*
lrwxrwxrwx 1 root root      20 Sep 10 03:48 /usr/lib/libQt5Core.so.5 -> libQt5Core.so.5.13.1*
lrwxrwxrwx 1 root root      20 Sep 10 03:48 /usr/lib/libQt5Core.so.5.13 -> libQt5Core.so.5.13.1*
-rwxr-xr-x 1 root root 5275240 Sep 10 03:48 /usr/lib/libQt5Core.so.5.13.1*

And by running strace, you can see it was found

...
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/tls/x86_64/x86_64/libQt5Core.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls/x86_64/x86_64", 0x7fffef547f50) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/tls/x86_64/libQt5Core.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls/x86_64", 0x7fffef547f50) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/tls/x86_64/libQt5Core.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls/x86_64", 0x7fffef547f50) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/tls/libQt5Core.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls", 0x7fffef547f50)    = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64/x86_64/libQt5Core.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64/x86_64", 0x7fffef547f50) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64/libQt5Core.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64", 0x7fffef547f50) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64/libQt5Core.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64", 0x7fffef547f50) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libQt5Core.so.5", O_RDONLY|O_CLOEXEC) = 3                <----- found it here
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \202\v\0\0\0\0\0"..., 832) = 832
close(3)                                = 0
stat("/usr/lib", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
writev(2, [{iov_base="wkhtmltopdf", iov_len=11}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {iov_base=": ", iov_len=2}, {iov_base="libQt5Core.so.5", iov_len=15}, {iov_base=": ", iov_len=2}, {iov_base="cannot open shared object file", iov_len=30}, {iov_base=": ", iov_len=2}, {iov_base="No such file or directory", iov_len=25}, {iov_base="\n", iov_len=1}], 10wkhtmltopdf: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory
) = 126
exit_group(127)                         = ?
+++ exited with 127 +++

How to reproduce
Just by running it.

Expected behavior
To not crash upon launching.

Conclusion
While I do realize that my setup is a bit unusual, I would still appreciate any help with figuring out why this is happening.

@tiagoefmoraes
Copy link

I solved it by running:
sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so

found this command here: microsoft/WSL#3023

@ddlaer0
Copy link

ddlaer0 commented Apr 29, 2020

I solved it by running:
sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so

found this command here: microsoft/WSL#3023

Thx! You made my day. I had created a singularity container for some software application. It worked on Ubuntu but not on CentOS system. It puzzled me for weeks. Even the customer support did not find the solution. Finally google came to the rescue with your post. This solved it ;)

@ashkulz
Copy link
Member

ashkulz commented Jun 5, 2020

I'm not sure I can do something for such a weird case like that, this is for a non-patched build I presume so it's something that'll have to be handled by the distro itself.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants