Silviu Petrut
Silviu Petrut

Reputation: 89

Qt deployment can't finde my libs but ldd can

When i try to run qt-deployment i got the fallowing error :

I also try to copy all the so files with ldd and put them in another system but then i got segmentation fault (core dump) error

./linuxdeployqt.AppImage /home/uia53314/LabelingTool8.0v/build-LabelingTool1-Desktop_Qt_5_12_3_GCC_64bit-Debug/LabelingTool
linuxdeployqt 5 (commit 37631e5), build 631 built on 2019-01-25 22:47:58 UTC
Not using FHS-like mode
app-binary: "/home/uia53314/LabelingTool8.0v/build-LabelingTool1-Desktop_Qt_5_12_3_GCC_64bit-Debug/LabelingTool"
appDirPath: "/home/uia53314/LabelingTool8.0v/build-LabelingTool1-Desktop_Qt_5_12_3_GCC_64bit-Debug"
relativeBinPath: "LabelingTool"
Keeping existing AppRun
ERROR: ldd outputLine: "/home/uia53314/Qt5.12.3/5.12.3/gcc_64/lib/libQt5Charts.so.5: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found (required by /home/uia53314/Qt5.12.3/5.12.3/gcc_64/lib/libQt5Charts.so.5)"
ERROR: for binary: "/home/uia53314/Qt5.12.3/5.12.3/gcc_64/lib/libQt5Charts.so.5"
ERROR: Please ensure that all libraries can be found by ldd. Aborting.

Here is my ldd output :

ldd LabelingTool 
    linux-vdso.so.1 =>  (0x00007ffcd7db1000)
    libQt5Charts.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Charts.so.5 (0x00007f0fb4b7f000)
    libQt5Widgets.so.5 => /home/uia53314/Qt5.12.3/5.12.3/gcc_64/lib/libQt5Widgets.so.5 (0x00007f0fb4331000)
    libQt5Gui.so.5 => /home/uia53314/Qt5.12.3/5.12.3/gcc_64/lib/libQt5Gui.so.5 (0x00007f0fb3b08000)
    libQt5Core.so.5 => /home/uia53314/Qt5.12.3/5.12.3/gcc_64/lib/libQt5Core.so.5 (0x00007f0fb3375000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0fb3158000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0fb2d75000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0fb2a6c000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0fb2854000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0fb248a000)
    libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f0fb2216000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f0fb1ffc000)
    libicui18n.so.56 => /home/uia53314/Qt5.12.3/5.12.3/gcc_64/lib/libicui18n.so.56 (0x00007f0fb1b63000)
    libicuuc.so.56 => /home/uia53314/Qt5.12.3/5.12.3/gcc_64/lib/libicuuc.so.56 (0x00007f0fb17ab000)
    libicudata.so.56 => /home/uia53314/Qt5.12.3/5.12.3/gcc_64/lib/libicudata.so.56 (0x00007f0fafdc8000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0fafbc4000)
    libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f0faf9c2000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f0faf6b1000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f0fb4f33000)
    libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f0faf488000)
    libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f0faf285000)
    libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f0faf082000)
    libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f0faee7b000)
    libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f0faec78000)
    libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f0faea47000)
    libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f0fae835000)
    libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f0fae632000)
    libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f0fae42c000)
    libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f0fae22a000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f0fadef0000)
    libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f0fadcd7000)
    libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f0fadad2000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f0fad8b0000)
    libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f0fad6aa000)
    libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f0fad498000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f0fad228000)
    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f0fad024000)
    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f0face1e000)

Upvotes: 0

Views: 818

Answers (1)

Some programmer dude
Some programmer dude

Reputation: 409374

You are linking with Qt libraries in non-standard locations. The dynamic run-time linker doesn't know about that location.

You need to tell the dynamic run-time linker about this custom location. This is either done by editing configuration files for it (on Linux it would be /etc/ld.so.conf); Or by setting the LD_LIBRARY_PATH to include the path (but many people advise agains using this environment variable); Or by telling the build-time linker ld to embed the path into the executable with the -rpath option (which is what I recommend).

Assuming you're using the g++ or clang++ front-end driver programs to build, you need to use the -Wl option to pass the -rpath option to the linker:

g++ <other flags> <object files> <libraries> -Wl,-rpath,/home/uia53314/Qt5.12.3/5.12.3/gcc_64/lib

Upvotes: 1

Related Questions