Porting C / C ++ to Android

I am trying to put my C ++ program on an Android phone, but have encountered several library binding problems. It seems that most of the useful information that I find on this topic through google is outdated ( motz ) or just does not take into account the complexity of my program, I was able to run simple C programs, but could not use libraries outside of Android Bionic / libc.

So my questions are:

  • Is it possible to transfer existing * .so libraries to Android? If so, how can I do this without seg failures?
  • Should I use the CodeSourcery compiler (arm-none-linux-gnueabi - *)?
  • How can I get around the lack of a separate pthread library?

Please help me! Thank.

-Scott

+3
source share
2 answers

You cannot use pre-existing * .so files because you need to compile them for Android. To create * .so for Android, you need to use your NDK, which is already configured to create the correct format, so you do not need to worry about arm-none-linux-gnueabi or anything else. If you want to use a library that is not available on Android, you will need to create it yourself using the NDK. I had to do this using STL.

+2
source

Source: https://habr.com/ru/post/1753587/


All Articles