How to compile user folder structure using ndk-build?

I have the following folder structure:


In $ My_Eclipse_Project

  • JNI / Android.mk
  • JNI / Application.mk
  • JNI / main.cpp
  • Library /

In $ My_Library_Project

  • CSI /
  • include /
  • Android.mk

$ My_Eclipse_Project / jni / main.cpp is the main makefile that calls the source code to compile, following the instructions from $ My_Library_Project / Android.mk

     # NOTE: $ (warning Compiling Android.mk from sample_cameraview_activity) # This path LOCAL_PATH: = $ (call my-dir) $ (warning Local path: $ (LOCAL_PATH)) # GNU var include $ (CLEAR_VARS) # Include extra library include $ (mylibrary_INCLUDE) /../ Android.mk # Add openCV # Add in .bashrc enviroment var include $ (OPENCV_SHARE_MK) /OpenCV.mk LOCAL_ARM_NEON: = true # Local libraries LOCAL_LDLIBS + = -llog -lGLESv1_MOD_MAL_OCAL_LOD_LIB_OCLM_OCLOD_LOD camView # Local SRC LOCAL_SRC_FILES: = main.cpp # Shared library include $ (BUILD_SHARED_LIBRARY) 

The problem is that $ My_Library_Project> Android.mk does not detect the folder structure, which is waiting, because my source is in the src folder, not in the jni folder. I get:

  Android NDK: Could not find application project directory!    
 Android NDK: Please define the NDK_PROJECT_PATH variable to point to it. 

How can I compile the code in $ My_Library_Project from $ My_Eclipse_Project and copy the library created in $ My_Eclipse_Project> lib / armeabi to be used by main.cpp?

Thanks in advance.

+4
source share
1 answer

2 Options. You can define $ NDK_PROJECT_PATH = / your_ndk_path, the Makefile will automatically determine the path and use it to compile or add an envroment variable named $ NDK_PROJECT_PATH and the value / your_ndk_path.

+4
source

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


All Articles