0

应用程序使用Qt 5.12.9 for Android构建良好。但是在链接阶段失败了5.15.1(编译良好,因为已弃用的 Qt API 已修复)。arm64-v8a仅为 ABI构建:

qmake ANDROID_ABIS="arm64-v8a" ...

有多个这样的链接错误:

~/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'

尝试修复AndroidManifest.xml此处提到的问题:Qt for Android known issues with no lucky。可通过安装最新的 Qt SDK 和从 docker 中的源代码构建的 Qt 进行重现。任何想法是什么问题以及如何解决?

参考:

4

1 回答 1

0

问题在于-nostdlib++以下行中的 hack 修复:QGCCommon.pri#L60

QMAKE_LINK += -nostdlib++ # Hack fix

对于5.15,需要删除它并打补丁AndroidManifest.xml才能正确构建 APK。此行可以在5.12中删除,因为它ndk20问题,而当前 Qt Creator 默认安装并使用ndk21

于 2020-10-23T14:31:11.000 回答