Multiple link errors building Qt 5.15 application for Android

745 views Asked by At

Application builds fine with Qt 5.12.9 for Android. However fails with 5.15.1 on linking phase (compiles fine as deprecated Qt API was fixed). Building for arm64-v8a ABI only:

qmake ANDROID_ABIS="arm64-v8a" ...

Have multiple link errors like this:

~/Qt/5.15.1/android/include/QtCore/qobjectdefs_impl.h:415: undefined reference to `operator delete(void*)'
obj/QGCMapEngine.o: In function `QList<QString>::append(QString const&)':
~/Qt/5.15.1/android/include/QtCore/qlist.h:626: undefined reference to `__cxa_begin_catch'
~/Qt/5.15.1/android/include/QtCore/qlist.h:628: undefined reference to `__cxa_rethrow'
~/Qt/5.15.1/android/include/QtCore/qlist.h:629: undefined reference to `__cxa_end_catch'
~/Qt/5.15.1/android/include/QtCore/qlist.h:644: undefined reference to `__cxa_begin_catch'
~/Qt/5.15.1/android/include/QtCore/qlist.h:646: undefined reference to `__cxa_rethrow'
~/Qt/5.15.1/android/include/QtCore/qlist.h:647: undefined reference to `__cxa_end_catch'

Tried to fix AndroidManifest.xml like mentioned here: Qt for Android known issues with no luck. Reproducible with latest Qt SDK installed and with Qt built from sources in docker. Any ideas what the problem is and how to fix?

References:

1

There are 1 answers

0
Aleksey Kontsevich On BEST ANSWER

Problem was in -nostdlib++ hack fix in the following line: QGCCommon.pri#L60

QMAKE_LINK += -nostdlib++ # Hack fix

For 5.15 need to remove it and patch AndroidManifest.xml to correctly build APK. This line could be removed for 5.12 as well as it was ndk20 problem while currently Qt Creator installs and uses ndk21 by default.