27

This question has been asked before, but the fixes don't work for me. I am running Windows 10 with WSL (Debian) and I am unable to run a QT program because of the error

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

I found a post which discusses the same problem. I've tried tolos' and Envek's solutions, but they don't work for me. For me the file is under /usr/lib/x86_64-linux-gnu/ like tolos' was. I also sudo-ed the strip and recompiled the qt program (If that even matters), but it still doesn't work.

If it matters, my kernel version (checked with uname -r) is 4.4.0-18362-Microsoft and I have no issues running this qt program on my other PC that uses WSL Ubuntu. And I installed the qt stuff with this command: sudo apt-get install qt5-default qtbase5-dev

Protofall
  • 612
  • 1
  • 6
  • 15

2 Answers2

24

I had an image that I would run using docker run and which would successfully launch KStars -- an application that uses this libQt5core.so.5.

If I ran the very same image on a Kubernetes cluster then I would get an error message when launching KStars like libQt5Core.so.5: cannot open shared object file: No such file or directory or some such.

Putting this strip command into the Dockerfile and rebuilding the image allowed the application to load successfully in both environments.

sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
warrens
  • 1,661
  • 18
  • 16
16

I got it working in the end. I upgraded from WSLv1 to WSLv2 and that solved it. Not sure why, but it must have been a WSLv1 Debian bug

Protofall
  • 612
  • 1
  • 6
  • 15
  • 49
    in WSL1 you have to: `sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 ` – s.ouchene Oct 29 '20 at 11:41
  • 1
    thanks it worked in my case `okular: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory` – rio Oct 30 '20 at 09:36
  • 1
    @s.ouchene: thanks man, it worked on my WSL 1.0 – k3nn Dec 11 '21 at 13:01
  • 1
    @k3nn: For details, please refer to this answer: https://stackoverflow.com/a/64594256/5920411 – s.ouchene Dec 11 '21 at 16:43
  • Worked in WSL1 to make `lyx` run. I never had problem until big batch of updates ran last week. Guess I learned my lesson! – pauljohn32 Jul 22 '22 at 01:56
  • Also worked in WSL 1 Ubuntu to compile [Granoo](https://www.granoo.org/install.html). I just updated it to WSL 2. – Zep Feb 10 '23 at 08:04