Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
libQt5X11Extras.so.5.13.2: undefined reference to `qt_version_tag@Qt_5.13'
Gluttony last edited by
I'm trying to embed Qt as an external library of our application, as we do for other libraries like boost, opencv, ... I'll spare your the details but we have our own way to package our application, for externals too and we cannot use https://doc.qt.io/qt-5/deployment.html or https://github.com/probonopd/linuxdeployqt, then, first I tried building Qt from source (as we did on our old OS with Qt 4.7.4) but does not work because cannot found the way to build libQt5WebEngine that we need, the way I found was to install Qt with run file (currently qt-opensource-linux-x64-5.13.2.run) in /tmp/Qt5 then do a package of this suitable for our external (especially include and lib folders must be in archive root), but, when trying to build our application after deployment of Qt there is following error:
[ 8%] Linking CXX executable ../../../bin/Debug/app /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: ../../../../External/Vendors/qt/lib/libQt5X11Extras.so.5.13.2: undefined reference to `qt_version_tag@Qt_5.13' collect2: error: ld returned 1 exit status distcc ERROR: compile (null) on localhost failed
From what I found on the internet some people fixed this error defining QT_NO_VERSION_TAGGING, in our case with add_definitions(-DQT_NO_VERSION_TAGGING) for CMake in CMakeListsCommon.cmake, but this was without success.
I also found qt_version_tag@... should be defined in libQtCore.so.5.13.2 (for Qt v5.13.2), there are actually several qt_version_tag@<minor.major> defined in this library (looked with nm <file> command) but for Qt_5.13 it is defined with two @ (00000000003a8380 R qt_version_tag@@Qt_5.13) but not sure this is an issue (it may just be to point out the current version) since in libQt5X11Extras.so.5.13.2 we can see it as undefined with two @ too (U qt_version_tag@@Qt_5.13).
For information, we also have Qt 5.9.4 installed on the system, it is needed for applications using Qt installed by the OS, but it seems not to interfere, performing a ldd on libQt5X11Extras.so.5.13.2 for which undefined reference is raised shows it actually links with the proper libQtCore.so (5.13.2):
linux:/path/to/workspace/lib/external>ldd libQt5X11Extras.so.5.13.2 [...] libQt5Core.so.5 => /path/to/workspace/lib/external/libQt5Core.so.5 (0x00007fb7c7948000) [...] linux:/path/to/workspace/lib/external>ll libQt5Core.so.5 libQt5Core.so.5 -> libQt5Core.so.5.13.2
Anyone knows what can be the issue and how can I fix this ?