Does the mobile terminal not support static compilation of Qt libraries?
-
../configure -xplatform android-clang -static -android-abis x86_64 -release -opensource -confirm-license -qt-host-path ... -android-sdk ... -android-ndk ...Use this configuration to successfully compile the QT android static library, and use this version library to create a project in Qt Creator Tips
...\lib\cmake\Qt6Core\Qt6CoreMacros.cmake:792:EVAL:1: error: Detected Qt installation does not contain qtforandroid_x86_64.so in the
following dir:.../plugins/platforms
This is most likely due to the installation not being a Qt for Android
build. Please recheck your build configuration.Call stack:
.../lib/cmake/Qt6Core/Qt6CoreMacros.cmake:792:EVAL:1 (qt6_finalize_target)
.../lib/cmake/Qt6Core/Qt6CoreMacros.cmake:823 (_qt_internal_finalize_executable)
.../lib/cmake/Qt6Core/Qt6CoreMacros.cmake:745 (cmake_language)
.../lib/cmake/Qt6Core/Qt6CoreMacros.cmake:745 (_qt_internal_android_executable_finalizer)
.../lib/cmake/Qt6Core/Qt6AndroidMacros.cmake:1565 (qt6_android_generate_deployment_settings)
.../lib/cmake/Qt6Core/Qt6AndroidMacros.cmake:125 (message)Copy an existing dynamic version of libplugins_platforms_qtforandroid_x86_64.so to the plugins\platforms directory and prompt when building
:-1: error: ld.lld: error: duplicate symbol: JNI_OnLoad
qjnihelpers.cpp:-1: defined at qjnihelpers.cpp
JNI_OnLoad) in archive D:-1: qjnihelpers.cpp.o:(JNI_OnLoad) in archive ... /lib/libQt6Core_x86_64.a
androidjnimain.cpp:-1: defined at androidjnimain.cpp
.text.JNI_OnLoad+0x0) in archive D:-1: androidjnimain.cpp.o:(.text.JNI_OnLoad+0x0) in archive ... /plugins/platforms/libqtforandroid_x86_64.a
:-1: error: linker command failed with exit code 1 (use -v to see invocation)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.Is it true that in terms of code implementation, only dynamic libraries can be loaded dynamically?
-
../configure -xplatform android-clang -static -android-abis x86_64 -release -opensource -confirm-license -qt-host-path ... -android-sdk ... -android-ndk ...Use this configuration to successfully compile the QT android static library, and use this version library to create a project in Qt Creator Tips
...\lib\cmake\Qt6Core\Qt6CoreMacros.cmake:792:EVAL:1: error: Detected Qt installation does not contain qtforandroid_x86_64.so in the
following dir:.../plugins/platforms
This is most likely due to the installation not being a Qt for Android
build. Please recheck your build configuration.Call stack:
.../lib/cmake/Qt6Core/Qt6CoreMacros.cmake:792:EVAL:1 (qt6_finalize_target)
.../lib/cmake/Qt6Core/Qt6CoreMacros.cmake:823 (_qt_internal_finalize_executable)
.../lib/cmake/Qt6Core/Qt6CoreMacros.cmake:745 (cmake_language)
.../lib/cmake/Qt6Core/Qt6CoreMacros.cmake:745 (_qt_internal_android_executable_finalizer)
.../lib/cmake/Qt6Core/Qt6AndroidMacros.cmake:1565 (qt6_android_generate_deployment_settings)
.../lib/cmake/Qt6Core/Qt6AndroidMacros.cmake:125 (message)Copy an existing dynamic version of libplugins_platforms_qtforandroid_x86_64.so to the plugins\platforms directory and prompt when building
:-1: error: ld.lld: error: duplicate symbol: JNI_OnLoad
qjnihelpers.cpp:-1: defined at qjnihelpers.cpp
JNI_OnLoad) in archive D:-1: qjnihelpers.cpp.o:(JNI_OnLoad) in archive ... /lib/libQt6Core_x86_64.a
androidjnimain.cpp:-1: defined at androidjnimain.cpp
.text.JNI_OnLoad+0x0) in archive D:-1: androidjnimain.cpp.o:(.text.JNI_OnLoad+0x0) in archive ... /plugins/platforms/libqtforandroid_x86_64.a
:-1: error: linker command failed with exit code 1 (use -v to see invocation)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.Is it true that in terms of code implementation, only dynamic libraries can be loaded dynamically?
Hi and welcome to the Qt Forum!
I don't understand exactly what the question is.
Is it true that in terms of code implementation, only dynamic libraries can be loaded dynamically?
If this is the question, the answer is YES.
-
Hi,
Static builds require extra steps with regards to plugins.
See the static plugins howto.