Ok, sorry for the noise, the solution was not so hard, just needed to also specify the libs per arch on top of the android extra libs
LIBS += \ $$OPEN_SSL_PATH/Android/$$ANDROID_TARGET_ARCH/libcrypto_1_1.so \ $$OPEN_SSL_PATH/Android/$$ANDROID_TARGET_ARCH/libssl_1_1.so From: Interest <interest-boun...@qt-project.org> on behalf of Jérôme Godbout <godbo...@amotus.ca> Date: Thursday, March 25, 2021 at 3:05 PM To: Qt Interest <interest@qt-project.org> Subject: [Interest] Android OpenSSL EVP Hi, anyone have use OpenSSL EVP interface under Android? I manage to make it work under MacOS, Windows, Linux, but under Android I can add the OpenSSL lib, I compiled them for each arch (x86, x86_64, armv7, armv8) and I add all the libs with (I use Qt 5.15.2 only for this): INCLUDEPATH+= $$OPEN_SSL_PATH/include ANDROID_EXTRA_LIBS += \ $$OPEN_SSL_PATH/Android/armeabi-v7a/libcrypto_1_1.so \ $$OPEN_SSL_PATH/Android/armeabi-v7a/libssl_1_1.so \ $$OPEN_SSL_PATH/Android/arm64-v8a/libcrypto_1_1.so \ $$OPEN_SSL_PATH/Android/arm64-v8a/libssl_1_1.so \ $$OPEN_SSL_PATH/Android/x86/libcrypto_1_1.so \ $$OPEN_SSL_PATH/Android/x86/libssl_1_1.so \ $$OPEN_SSL_PATH/Android/x86_64/libcrypto_1_1.so \ $$OPEN_SSL_PATH/Android/x86_64/libssl_1_1.so This work to use OpenSSL, but I cannot use the EVP, header are added, it fail at link time of the Qt application. I’m not even sure what Qt does with ANDROID_EXTRA_LIBS and how can the C++ code can link against the current arch lib? Any way to do this that will work on each arch? This is how I compiled my libs btw (under MacOS): #!/bin/bashVERSION=1.1.1j ANDROID_SDK_HOME=/Users/Shared/AndroidSDK export ANDROID_NDK_HOME=$ANDROID_SDK_HOME/ndk/21.1.6352462 if [ ! -f "openssl-$VERSION.tar.gz" ]; then wget https://www.openssl.org/source/openssl-$VERSION.tar.gz fi for arch in "armeabi-v7a" "arm64-v8a" "x86" "x86_64" do pushd . rm -fr $arch mkdir $arch rm -fr openssl-$VERSION tar xf openssl-$VERSION.tar.gz cd openssl-$VERSION case $arch in armeabi-v7a) ANDROID_API=16 CONFIG_ARCH="arm" ;; x86) ANDROID_API=16 CONFIG_ARCH="x86" ;; arm64-v8a) ANDROID_API=21 CONFIG_ARCH="arm64" ;; x86_64) ANDROID_API=21 CONFIG_ARCH="x86_64" ;; esac ANDROID_TOOLCHAIN="" for host in "linux-x86_64" "linux-x86" "darwin-x86_64" "darwin-x86" do if [ -d "$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$host/bin" ]; then ANDROID_TOOLCHAIN="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$host/bin" break fi done export PATH="$ANDROID_TOOLCHAIN":"$PATH" ./Configure shared android-${CONFIG_ARCH} -D__ANDROID_API__=${ANDROID_API} || exit 1 make depend make -j$(nproc) SHLIB_VERSION_NUMBER= SHLIB_EXT=_1_1.so build_libs || exit 1 llvm-strip --strip-all libcrypto_1_1.so llvm-strip --strip-all libssl_1_1.so cp libcrypto_1_1.so ../$arch || exit 1 cp libssl_1_1.so ../$arch || exit 1 popd done Jérôme Godbout, B. Ing. Software / Firmware Team Lead O: (418) 682-3636 ext.: 114 C: (581) 777-0050 godbo...@dimonoff.com<mailto:godbo...@dimonoff.com> [signature_868826015]<https://www.dimonoff.com/> dimonoff.com<https://www.dimonoff.com/> 1015 Avenue Wilfrid-Pelletier, Québec, QC G1W 0C4, 4e étage
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest