1 Attachment(s)
Deploying a Qt application on Android: adding additional libraries such as OpenSSL
Hi,
As the title already says, I'm currently trying to deploy additional libraries (such as OpenSSL) within my Qt application.
I compiled Qt 5.3.1 as well as OpenSSL for Android from the sources.
Compiling and deploying a first test application (http://qt-project.org/doc/qt-5/qtsen...e-example.html) worked fine. I think the Android version of Qt is configured well.
Now I'm trying to link against OpenSSL:
Code:
LIBS += -L/opt/android-openssl/usr/lib/ -lcrypto
INCLUDEPATH += /opt/android-openssl/usr/include
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
ANDROID_EXTRA_LIBS += /opt/android-openssl/usr/lib/libcrypto.so.1.0.0
Compilation seems to work, but deploying fails.
I'm getting a clear error message:
Quote:
The file name of external library /opt/android-openssl/usr/lib/libcrypto.so.1.0.0 must begin with "lib" and end with the suffix ".so".
Simply renaming the file does not work of course since my program links against "libcrypto.so.1.0.0" and doesn't find a file "libcrypto.so". But I'm only able to deploy a file named "libcrypto.so". That's the problem.
How can I walk around the problem?
Can I try to get a file called "libcrypto.so" without version suffix? Here's the script I'm using to build OpenSSL: Attachment 10571
(I simply modified the script from the Arch repository: https://www.archlinux.org/packages/core/x86_64/openssl/)
How to configure OpenSSL to leave the version suffix? I searched a lot but I've found no solution yet.
The documentation of OpenSSL says:
Quote:
Specify the full library name when calling Java's System.load. That is, call System.load(“libcrypto.so.1.0.0â€). Also note that some Android routines expect the prefix of “lib†and suffix of “soâ€, so you might have to rename the library.
(http://wiki.openssl.org/index.php/Android#Miscellaneous)
I was not able to simply rename the file. "readelf -d" still says my application links against "libcrypto.so.1.0.0" and it doesn't find the library without version suffix. How to rename a library probably (or in the sense of this documentation)?
Thanks for helping.
Re: Deploying a Qt application on Android: adding additional libraries such as OpenSS
Try to rename it using OS tools ...
Re: Deploying a Qt application on Android: adding additional libraries such as OpenSS
About what tools are you talking about exactly? The operating system I'm using is Arch Linux.
EDIT: I solved the problem by editing the Makefile of OpenSSL in the PKGBUILD file to leave the version suffix. Now I'm able to compile and deploy the application. But I'm still interested in those tools because they might be useful anyways.