2

I tried many times to compile c file in Android Studio but all fell through.. On the Internet there are many instruction how to do it but each of these there are different from other.. One use CMake (it isn't available from Android Studio 2.2.3 SDK Tools), another use Android.mk and Application.mk (after tried it I had error: make (e=2): The system cannot find the file specified.) and others..

Is there one useful instruction that could help me to compile c file in Android Studio?
Can anyone help me? I would appreciate if you give me step by step solution how to do it.

Sorry for my English. Thanks!

  • You haven't mention what kind of compilation result you'd like to get, but have a look at [Building executables for Android shell](http://stackoverflow.com/questions/35231168/building-executables-for-android-shell) in case you need an executable. If not, use `BUILD_SHARED_LIBRARY` in `include $(...)` of [Android.mk](http://android.mk/) or call a corresponding method in `CMakeLists.txt`, depending of the kind of build tool you're going to use. – Onik Jan 14 '17 at 01:38
  • I want to add [this](http://stackoverflow.com/a/11260177) to my project, but one way when I use `Android.mk` and `Application.mk` and when I run `ndk-build` in `cmd` I have this error: `make (e=2): The system cannot find the file specified`. Other way when I use `CMakeList.txt` and build a project I have this error: `Error:executing external native build for cmake ...\CMakeLists.txt` ... How can I solve this? – Sylwester Muzyka Jan 14 '17 at 13:00

1 Answers1

0

I did it using CMake and followed this link.