leenjewel / openssl_for_ios_and_android

OpenSSL Library for iOS and Android
927 stars 318 forks source link

NDK version supported and linker issue #19

Closed dkhanchopoulo closed 7 years ago

dkhanchopoulo commented 7 years ago

Dear leenjewel,

kindly assist which NDK version I have use for build /build-openssl4android.sh

I tried with NDK-15 and g++ compiler

apps/ca.o: In function do_body': ca.c:(.text.unlikely+0x1108): undefined reference tostdin' apps/openssl.o: In function main': openssl.c:(.text.startup+0x1c8): undefined reference tostpcpy' openssl.c:(.text.startup+0x21c): undefined reference to signal' apps/ca.o: In functiondo_body': ca.c:(.text.unlikely+0x1108): undefined reference to stdin' apps/openssl.o: In functionmain': openssl.c:(.text.startup+0x1c8): undefined reference to stpcpy' openssl.c:(.text.startup+0x21c): undefined reference tosignal'

:ui_openssl.c:function open_console: error: undefined reference to 'stdin'

dkhanchopoulo commented 7 years ago

When my application is compiled: pem_lib.c:function PEM_def_callback: error: undefined reference to 'stderr'

dkhanchopoulo commented 7 years ago

armeabi-v7a/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_expand_block: error: undefined reference to 'inflate'

dkhanchopoulo commented 7 years ago

finally when I add zlib in my test project the only case is missing: ../../../../libs/armeabi-v7a/libcrypto.a(cryptlib.o):cryptlib.c:function OPENSSL_showfatal: error: undefined reference to 'stderr' ../../../../libs/armeabi-v7a/libcrypto.a(pem_lib.o):pem_lib.c:function PEM_def_callback: error: undefined reference to 'stderr' ../../../../libs/armeabi-v7a/libcrypto.a(eng_openssl.o):eng_openssl.c:function openssl_load_privkey: error: undefined reference to 'stderr' ../../../../libs/armeabi-v7a/libcrypto.a(eng_openssl.o):eng_openssl.c:function test_rc4_init_key: error: undefined reference to 'stderr' ../../../../libs/armeabi-v7a/libcrypto.a(ui_openssl.o):ui_openssl.c:function close_console: error: undefined reference to 'stdin' ../../../../libs/armeabi-v7a/libcrypto.a(ui_openssl.o):ui_openssl.c:function open_console: error: undefined reference to 'stdin' clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.

leenjewel commented 7 years ago

Which Android API version do you use ?

dkhanchopoulo commented 7 years ago

android API 21. I find the reason. It is connected to NDK 15, If i use NDK 14, there is no issue.

leenjewel commented 7 years ago

OK cool, I update my readme to explain it