Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Building OpenSSL libraries for Android, from windows
Forum Updated to NodeBB v4.3 + New Features

Building OpenSSL libraries for Android, from windows

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 1 Posters 8.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    elfietro
    wrote on 17 Mar 2014, 14:48 last edited by
    #1

    Hello,
    I have a simple chat program that uses OpenSSL
    It works fine on windows, but I want to deploy it on android.
    I tried to build the libcrypto and libssl libraries for android.

    I got the information how to to it in linux here:
    http://qt-project.org/doc/qt-5/opensslsupport.html

    but if I go to the OpenSSL source directory, Configure is not recognized anymore
    if I use the full path (C:\Qt\Qt5.2.1\5.2.1\Src\qtbase\configure.bat)
    it says "andriod is an unknown option" (android-armv7 also)
    I do not have a "make" or "build_lib" in windows equivalent to the scripts in linux.
    how does configure know in which directory im am configuring?
    how do I compile those openSSL sources to libcrypto.so and libssl.so (or libcrypto.lib and libssl.lib) from windows command prompt, so that I can package them into my APK for android?
    what is the difference between .so libraries and .lib libraries?

    please help! I am coming from visual studio and never did anything outside windows!

    1 Reply Last reply
    0
    • E Offline
      E Offline
      elfietro
      wrote on 17 Mar 2014, 17:37 last edited by
      #2

      ok I downloaded the Msys shell,
      and I see the script Configure in the OpenSSL-Source directory
      but when i run it with "./Configure shared android" it gives me:
      ./Configure: line 2: exec: perl: not found

      still need help!

      1 Reply Last reply
      0
      • E Offline
        E Offline
        elfietro
        wrote on 17 Mar 2014, 18:03 last edited by
        #3

        ok i needed to install perl for windows, which I did (ActivePerl)
        now next problem, when i use make build_libs: gcc.exe: error: unrecognized command line option '-mandroid'

        here is complete output:

        $ make build_libs
        making all in crypto...
        make[1]: Entering directory /c/openssl-1.0.1f/crypto' ( echo "#ifndef MK1MF_BUILD"; \ echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \ echo ' #define CFLAGS "gcc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REE NTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -mandroid -I/include -B/lib -O3 -fomit-frame-p ointer -Wall"'; \ echo ' #define PLATFORM "android"'; \ echo " #define DATE \"LC_ALL=C LC_TIME=C date\""; \ echo '#endif' ) >buildinf.h gcc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -D DSO_DLFCN -DHAVE_DLFCN_H -mandroid -I/include -B/lib -O3 -fomit-frame-pointer -W all -c -o cryptlib.o cryptlib.c gcc.exe: error: unrecognized command line option '-mandroid' make[1]: *** [cryptlib.o] Error 1 make[1]: Leaving directory /c/openssl-1.0.1f/crypto'
        make: *** [build_crypto] Error 1

        1 Reply Last reply
        0
        • E Offline
          E Offline
          elfietro
          wrote on 18 Mar 2014, 14:41 last edited by
          #4

          ok, I was using wrong GCC.exe or G++.exe compiler
          I adjusted my $PATH variable to include :
          C:\android\AndroidNDK\toolchains\arm-linux-androideabi-4.6\prebuilt\windows-x86_64\arm-linux-androideabi\bin

          libcrypto.so and libssl.so are now created.

          1 Reply Last reply
          1

          1/4

          17 Mar 2014, 14:48

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved