K
K
Konstantin2020-03-05 23:53:25
Qt
Konstantin, 2020-03-05 23:53:25

How to make a Qt application portable?

Wrote the simplest application in Qt, outputs hello.
I made the assembly on one virtual machine with Ubuntu 18.04 and Qt 5.14 installed from the official qt website.
And I run the binary on the second virtual machine with Ubuntu 18.04, but with the version 5.9.5 library installed from the repository

Example of actions:
I look at the missing libraries, libQt5Core.so.5 is missing

ldd checkOnline
        linux-vdso.so.1 (0x00007ffd227e6000)
        libQt5Core.so.5 => not found
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb1951ea000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb194fd2000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb194be1000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb194843000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb195776000)


I install the package with the required lib: I check
apt install libqt5gui5

, I found the necessary lib, but swears at the need for a higher version:
ldd checkOnline
./checkOnline: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.14' not found (required by ./checkOnline)
        linux-vdso.so.1 (0x00007fffa4d38000)
        libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f1d46f0e000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1d46b85000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1d4696d000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1d4657c000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1d4635d000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1d46140000)
        libicui18n.so.60 => /usr/lib/x86_64-linux-gnu/libicui18n.so.60 (0x00007f1d45c9f000)
        libicuuc.so.60 => /usr/lib/x86_64-linux-gnu/libicuuc.so.60 (0x00007f1d458e8000)
        libdouble-conversion.so.1 => /usr/lib/x86_64-linux-gnu/libdouble-conversion.so.1 (0x00007f1d456d7000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1d454d3000)
        libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f1d451bc000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1d44e1e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1d4785c000)
        libicudata.so.60 => /usr/lib/x86_64-linux-gnu/libicudata.so.60 (0x00007f1d43275000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f1d43003000)


Launch:
./checkOnline
./checkOnline: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.14' not found (required by ./checkOnline)


I suppose that you can take the missing libs with you to the second virtual machine, but what other options could there be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wexter, 2020-03-06
@webmaster

1) Either together with the binary
2) Build for the version from the system repository
3) Static build

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question