How to compile using Ubuntu 18 repo libraries only
-
wrote on 22 Aug 2021, 18:29 last edited by
I have installed Qt Creator on Ubuntu 18, and compiled my app against Qt 5.9.8 which I installed with Qt Creator.
I copied my executable to another Ubuntu 18 box, and added the Qt5* libraries from the default repo. And I confirmed the libraries are version 5.9.8
However, when I run my program I get error:
relocation error: ./myapp: symbol _ZdlPvm version Qt_5 not defined in file libQt5Core.so.5 with link time reference
From what I read online there is some kind of mismatch in the libraries. So, I built another Ubuntu 18 VM where I would like to recompile my app. This time I won't install Qt Creator, I just want to add the Qt5 libraries from the "Default" repo. But I can't figure out what to add.
Which Ubuntu libraries/tools do I need to install to compile my app?
-
build-essential and qtbase5-dev should get you started.
-
Hi,
Which modules are you using ?
You can start with qtbase5-dev and add all the modules you use with corresponding packages.
-
wrote on 22 Aug 2021, 19:18 last edited by
According to ldd my app needs:
linux-vdso.so.1 (0x00007ffd3fbf7000) libQt5Network.so.5 => /opt/Qt/5.9.9/gcc_64/lib/libQt5Network.so.5 (0x00007fed62674000) libQt5Sql.so.5 => /opt/Qt/5.9.9/gcc_64/lib/libQt5Sql.so.5 (0x00007fed6242d000) libQt5Core.so.5 => /opt/Qt/5.9.9/gcc_64/lib/libQt5Core.so.5 (0x00007fed61ce6000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fed61ac7000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fed6173e000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fed61526000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fed61135000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fed60f18000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fed60b7a000) libicui18n.so.56 => /opt/Qt/5.9.9/gcc_64/lib/libicui18n.so.56 (0x00007fed606e1000) libicuuc.so.56 => /opt/Qt/5.9.9/gcc_64/lib/libicuuc.so.56 (0x00007fed60329000) libicudata.so.56 => /opt/Qt/5.9.9/gcc_64/lib/libicudata.so.56 (0x00007fed5e946000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fed5e742000) libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fed5e540000) libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fed5e229000) /lib64/ld-linux-x86-64.so.2 (0x00007fed62a06000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fed5dfb7000)
I grabbed the above from a different system, but hopefully that answers question. Under centOS I found instructions for adding all compiler tools in one step, and Qt packages. But can't find anything similar for Ubuntu
-
build-essential and qtbase5-dev should get you started.
-
wrote on 23 Aug 2021, 00:01 last edited by ocgltd
@SGaist said in How to compile using Ubuntu 18 repo libraries only:
I added the above packages plus qt5-default and I was able to compile. I also moved my old Qt (installed from Qt Creator) from /opt/Qt to /tmp/Qt so there would be no conflict.
1/5