I have a library written with C++11 (thread, smart pointers). For HTTP support this library uses libcurl with openssl for HTTPS support. Before this lib had to work only at Windows and iOS. But I got a task to run it on Android.
Our requirements is next:
- NDK Android-21 platform (looks like on this platform we get correct C++11 support).
- libcurl version 7.44.0
- OpenSSL libraries (libcrypto, libssl) version 1.0.2d
I want to use this versions of libs, because we are using it at Windows and iOS.
I managed to build those libraries for armeabi with Android-21 platform toolchain. Also I managed to build sources of my library. But when I link all together I got those errors:
third_party/android/prebuilt/arm\libcurl.a(libcurl_la-curl_ntlm_wb.o): In function `ntlm_wb_init':
curl_ntlm_wb.c:(.text+0x194): undefined reference to `getpwuid_r'
curl_ntlm_wb.c:(.text+0x314): undefined reference to `getpwuid_r'
jni/../../../stsw_third_party/android/prebuilt/arm\libcrypto.a(ui_openssl.o): In function `read_string_inner':
ui_openssl.c:(.text+0x16c): undefined reference to `signal'
ui_openssl.c:(.text+0x294): undefined reference to `tcsetattr'
ui_openssl.c:(.text+0x330): undefined reference to `tcsetattr'
jni/../../../stsw_third_party/android/prebuilt/arm\libcrypto.a(ui_openssl.o): In function `open_console':
ui_openssl.c:(.text+0x5fc): undefined reference to `tcgetattr'
I think that Android does not have terminal methods in own API and I decided to build OpenSSL without UI (command line interface). But the problem is that libcurl requires OpenSSL UI with this OpenSSL version. OpenSSL uses user interface abstraction to negotiate access to private keys in the cryprographical engines.
Is it possible to build libcurl for android with latest OpenSSL? Should I change my toolchain?