Results 1 to 3 of 3

Thread: Deploying a Qt application on Android: adding additional libraries such as OpenSSL

  1. #1
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Question 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:
    Qt Code:
    1. LIBS += -L/opt/android-openssl/usr/lib/ -lcrypto
    2. INCLUDEPATH += /opt/android-openssl/usr/include
    3. ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
    4. ANDROID_EXTRA_LIBS += /opt/android-openssl/usr/lib/libcrypto.so.1.0.0
    To copy to clipboard, switch view to plain text mode 
    Compilation seems to work, but deploying fails.
    I'm getting a clear error message:
    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: PKGBUILD.sh
    (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:
    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.
    Last edited by Infinity; 21st August 2014 at 00:39.

  2. #2
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Deploying a Qt application on Android: adding additional libraries such as OpenSS

    Try to rename it using OS tools ...
    Qt 5.3 Opensource & Creator 3.1.2

  3. #3
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default 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.
    Last edited by Infinity; 21st August 2014 at 21:22.

Similar Threads

  1. Deploying desktop application on android
    By Baso in forum Installation and Deployment
    Replies: 0
    Last Post: 3rd December 2013, 19:08
  2. Deploying an app with additional library
    By kornicameister in forum Qt Programming
    Replies: 8
    Last Post: 10th July 2011, 16:51
  3. [QTabWidget] Adding additional button
    By winuser in forum Newbie
    Replies: 1
    Last Post: 3rd December 2010, 13:56
  4. Deploying applications with new Qt libraries
    By Luc4 in forum Qt Programming
    Replies: 0
    Last Post: 24th June 2010, 23:31
  5. Replies: 2
    Last Post: 17th April 2010, 17:40

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.