Solved Building for Android on a Windows host using OpenSSL
-
Hi. I'm attempting to use the QNetworkAccessManager class to communicate with a REST API but I can't seem to find any working instructions on how to build a Qt Android app on a Windows host with OpenSSL support. I can only find Linux instructions.
I'd like to avoid moving my development environment over to Linux so any hints, tips or directions would be appreciated greatly.
Currently building using the 'armeabi-v7a (Clang Qt 5.12.0 for Android ARMv7)' kit.
-
Hi,
One possibility could be to just build OpenSSL for Android on a Linux virtual machine and copy it to your Windows machine. Then you can continue to build your application on Windows.
-
Thanks for the reply and the great suggestion.
So in the end I built OpenSSL for android on Linux in a VM and I can now use the shared libraries thatI built (libssl.so and libcrypto.so) when working on Windows using the following in my .pro file:
ANDROID_EXTRA_LIBS+=$$PWD/openssl/1.0.2q/libcrypto.so ANDROID_EXTRA_LIBS+=$$PWD/openssl/1.0.2q/libssl.so
That being said the documentation that Qt provide could use some TLC (http://doc.qt.io/qt-5/android-openssl-support.html). It would be nice if there was a definitive list of known working NDK/android SDK/openSSL versions because it's a bit of a rabbit hole. I also found building for arm64 as described on that page didn't work.
Either way I have my 32bit armv7 build of OpenSSL so I can work with that for now.
Thanks again for the suggestion :)
-
You can get the version used when building Qt using QSslSocket::sslLibraryBuildVersionString.