0

I'm trying to deploy a Qt6 application on a Ubuntu 24.04 machine. Here my dist content:

. ├── libQt6Core.so ├── libQt6Core.so.6 ├── libQt6Core.so.6.8.0 ├── libQt6Gui.so ├── libQt6Gui.so.6 ├── libQt6Gui.so.6.8.0 ├── libQt6SerialPort.so ├── libQt6SerialPort.so.6 ├── libQt6SerialPort.so.6.8.0 ├── libQt6Widgets.so ├── libQt6Widgets.so.6 ├── libQt6Widgets.so.6.8.0 ├── MyApp └── platforms └── libqxcb.so 

Then I tried to run MyApp as follow:

$ export LD_LIBRARY_PATH=$(pwd) $ echo $LD_LIBRARY_PATH /home/user/Documents/dist $ ./MyApp 

but it returns:

./MyApp: error while loading shared libraries: libQt6Widgets.so.6: cannot open shared object file: No such file or directory

As you can see the file exists and is there. After exporting theLD_LIBRARY_PATH this is the output of ldd:

$ ldd MyApp linux-vdso.so.1 (0x00007ffc29796000) libQt6Widgets.so.6 => not found libQt6Gui.so.6 => not found libQt6SerialPort.so.6 => not found libQt6Core.so.6 => not found libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007583d5000000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007583d53ff000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007583d4c00000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007583d5316000) /lib64/ld-linux-x86-64.so.2 (0x00007583d545a000) 

I read this and this questions (among many others) but I still have issues. Why it does not find the files even if they are there?

6
  • First, why are you putting them in your local directory? Why not just add a file /etc/ld.so.conf.d/local.conf with contents /home/user/Documents/dist, then run ldconfig? No need to export LD_LIBRARY_PATH Commented Nov 20, 2024 at 14:14
  • @BobGoddard, perhaps I didn't understand your hint. But as far as I know, ldconfig will just look in the given path. But I need the libraries in the local directory in order to deploy it to another machine Commented Nov 20, 2024 at 14:22
  • Sounds like relative 'rpath' embedded in the binary might be a better way to do it? Commented Nov 20, 2024 at 14:56
  • Also, just to make sure.. is the MyApp executable setuid/setgid or normal? Commented Nov 20, 2024 at 14:57
  • @grawity, yes, nothing different than normal I think. I'm aware rpath is another way, but I want to learn how to use LD_LIBRARY_PATH in this question. Commented Nov 20, 2024 at 16:39

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.