I've got a different compilation. In QT5 my error is the following:
.obj/qxcbeglwindow.o:qxcbeglwindow.cpp:vtable for QXcbEglWindow : erreur : référence à « QXcbWindow::handleXIMouseEvent(xcb_ge_event_t*, Qt::MouseEventSource) » non définie.obj/qxcbeglwindow.o:qxcbeglwindow.cpp:vtable for QXcbEglWindow : erreur : référence à « QXcbWindow::handleXIEnterLeave(xcb_ge_event_t*) » non définiecollect2: error: ld returned 1 exit statusmake[10]: *** [../../../../../../plugins/xcbglintegrations/libqxcb-egl-integration.so] Error 1
Googling the error message I did not found more info so I've tried to upgrade to Qt last stable release (5.11.1) and I've got a different compilation error (still not lucky):
.obj/qtextengine.o:qtextengine.cpp:fonction QTextEngine::itemize() const : erreur : référence à « QtPrivate::isRightToLeft(QStringView) » non définiecollect2: error: ld returned 1 exit status
Regarding the first error reported, I suspect that some Qt library is dragging libpng16 whereas in SuperBuild we build libpng. Both depend on zlib. And since the libpng16 on bionic may be built using a more recent version of zlib, it reports a missing symbol which should be present in system zlib (but we use SuperBuild zlib).
FYI, I had installed an Ubuntu 18.04 LTS in a VM.
I had no problem to compile OTB with SuperBuild and the default configuration ; libpng is installed on my OS.
I am trying to reproduce the error in a docker container, but I am stuck somewhere in the build step of Qt5 (different error from the one reported here): link error against libQt5Core.so.5
/opt/otb/build/OTB-SuperBuild/QT5/build/qtbase/bin/qvkgen: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory
@mgrizonnet : did you check if your ubuntu bionic had the packages required by qtbase5-dev ?
@pasero: qtbase5-dev is installed on my bionic with the required packages. I'm a bit lost (we've got already 3 different compilation errors related to qt5 in this issue...:)
grizonnetm@pc-grizonnetm ~ $ aptitude show qtbase5-devPaquet : qtbase5-dev Version : 5.9.5+dfsg-0ubuntu1État: installéAutomatiquement installé: nonMultiarchitecture : mêmePriorité : optionnelSection : libdevelResponsable : Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>Architecture : amd64Taille décompressée : 13,4 MDépend: libgl1-mesa-dev | libgl-dev, libgles2-mesa-dev | libgles2-dev, libglu1-mesa-dev | libglu-dev, libqt5concurrent5 (= 5.9.5+dfsg-0ubuntu1), libqt5core5a (= 5.9.5+dfsg-0ubuntu1), libqt5dbus5 (= 5.9.5+dfsg-0ubuntu1), libqt5gui5 (= 5.9.5+dfsg-0ubuntu1), libqt5network5 (= 5.9.5+dfsg-0ubuntu1), libqt5printsupport5 (= 5.9.5+dfsg-0ubuntu1), libqt5sql5 (= 5.9.5+dfsg-0ubuntu1), libqt5test5 (= 5.9.5+dfsg-0ubuntu1), libqt5widgets5 (= 5.9.5+dfsg-0ubuntu1), libqt5xml5 (= 5.9.5+dfsg-0ubuntu1), libxext-dev, qt5-qmake (= 5.9.5+dfsg-0ubuntu1), qtbase5-dev-tools (= 5.9.5+dfsg-0ubuntu1), qtchooserRecommande: libqt5opengl5-dev (= 5.9.5+dfsg-0ubuntu1)Suggère: default-libmysqlclient-dev, firebird-dev, libegl1-mesa-dev, libgl1-mesa-dev, libpq-dev, libsqlite3-dev, unixodbc-devCasse: qtbase5-dev:i386 (!= 5.9.5+dfsg-0ubuntu1)Remplace: qtbase5-dev:i386 (< 5.9.5+dfsg-0ubuntu1)Description : Fichiers de développement de base Qt 5 Qt est un cadre applicatif C++ multiplate-forme. Sa principale caractéristique est son grand nombre de composants qui fournissent les fonctionnalités classiques d'une interface graphique. Ce paquet contient les fichiers de développement d'en-tête utilisés pour la compilation d'applications Qt 5. If you are interested in packaging Qt 5 stuff please take a look at http ://pkg-kde.alioth.debian.org/packagingqtbasedstuff.htmlSite : http://qt-project.org/
Update : the compilation error I got was due to a configuration problem on my side (long story short: running a recent distrib in a docker with an old kernel version can be tricky).
Hopefully, I have a workaround, I'll resume digging.
Ok, the problem is here, QtGui is linked to your system libfreetype, which drags libpng16. In my build is doesn't link to libfreetype (which is strange...)
Build type: linux-g++ (x86_64, CPU features: mmx sse sse2)Configuration: use_gold_linker sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples enable_new_dtags f16c largefile precompile_header rdrnd shani shared rpath release c++11 c++14 c++1z concurrent reduce_exports reduce_relocations stlBuild options: Mode ................................... release Optimize release build for size ........ no Building shared libraries .............. yes Using C++ standard ..................... C++1z Using ccache ........................... no Using gold linker ...................... yes Using new DTAGS ........................ yes Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX .................................. AVX AVX2 AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI Other x86 ............................ AES F16C RDRAND SHA Build parts ............................ tools libsQt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... no Qt D-Bus directly linked to libdbus .... no Qt Gui ................................. yes Qt Network ............................. yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yesSupport enabled for: Using pkg-config ....................... yes QML debugging .......................... yes udev ................................... no Using system zlib ...................... yesQt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... no iconv .................................. yes ICU .................................... no Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no Using system PCRE2 ..................... noQt Network: getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no OpenSSL ................................ no Qt directly linked to OpenSSL ........ no SCTP ................................... no Use system proxies ..................... yesQt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ yes HarfBuzz ............................... yes Using system HarfBuzz ................ yes Fontconfig ............................. no Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... yes PNG .................................. yes Using system libpng ................ yes EGL .................................... no OpenVG ................................. no OpenGL: Desktop OpenGL ....................... yes OpenGL ES 2.0 ........................ no OpenGL ES 3.0 ........................ no OpenGL ES 3.1 ........................ no OpenGL ES 3.2 ........................ no Vulkan ................................. no Session Management ..................... yesFeatures used by QPA backends: evdev .................................. yes libinput ............................... no INTEGRITY HID .......................... no mtdev .................................. no tslib .................................. no xkbcommon-evdev ........................ noQPA backends: DirectFB ............................... no EGLFS .................................. no LinuxFB ................................ yes VNC .................................... yes Mir client ............................. no X11: Using system-provided XCB libraries .. no EGL on X11 ........................... no Xinput2 .............................. yes XCB XKB .............................. yes XLib ................................. yes XCB render ........................... yes XCB GLX .............................. yes XCB Xlib ............................. yes Using system-provided xkbcommon ...... no Native painting (experimental) ....... noQt Widgets: GTK+ ................................... no Styles ................................. Fusion WindowsQt PrintSupport: CUPS ................................... noQt Sql: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... noNote: Also available for Linux: linux-clang linux-iccNote: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing.
BTW I've a local branch which udpate to the last qt stable version 5.11.1 and add extra configure options to optimize the size of the output qt libs. Could perhaps be done at the same time...