Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot locate symbol 'tcgetattr' referenced by "libcrypto.so"

I'm building a helper library for Android apps and I need a full OpenSSL implementation for some of the support libraries I'm using. I'm creating a build chain and compiling libssl and libcrypto with it but at runtime I get:

java.lang.ExceptionInInitializerError
  Caused by: java.lang.UnsatisfiedLinkError: Cannot load library:
    soinfo_relocate(linker.cpp:975): cannot locate symbol "tcgetattr" referenced by "libcrypto.so.1.0.0"...

I'm guessing there's something I need to do to help locate tcgetattr at runtime?

like image 683
Kagetsuki Avatar asked Oct 19 '15 02:10

Kagetsuki


1 Answers

Android runtime has significantly changed between API 19 and API 21. The NDK libraries reflect this change, and many symbols (e.g. srand) are now exported from the system libraries. Therefore is important to set APP_PLATFORM (if Android.mk is used) or platformVersion (if experimental plugin is used) not higher than the lowest SDK version that your app supports.

like image 83
Alex Cohn Avatar answered Oct 20 '22 11:10

Alex Cohn