How to specify c header file in android.mk file -
i had c source folder name "clib" , in , have example files 1.h ,1.c , 2.h ,2.c,3.c,3.h , out side folder have 4.h , 4.c , 4_jni.h , 4_jni.c
now build ".so" created android.mk this
local_path := $(call my-dir) my_path := $(local_path) include $(call all-subdir-makefiles) include $(clear_vars) local_path := $(my_path) local_ldlibs := -l$(sysroot)/usr/lib -llog local_module := clib time_sync_path := ../../../clib local_src_files := \ 4_jni.c \ 4.c \ $(time_sync_path)/1.c \ $(time_sync_path)/2.c \ $(time_sync_path)/3.c \ $(build_shared_library)
here 4.h includes 1.h file
so real problem when tried build .so file gives me error this
fatal error: 1.h: no such file or directory
if remove 1.h 4.h , building fine , had large c library same kind of folder structure , , of .h file contains few marcos defined ....
so please suggestion how include .h in different folder..
you need specify local_c_includes
location.
this variable holds locations of header files :
local_c_includes := $(local_path)/src/include/
you can of course specify multiple locations :
local_c_includes := $(local_path)/src/include/ local_c_includes += $(local_path)/project2/src/include/
note when variable evaluated ndk-build
utility, value considered relative $(local_path)
, need use $(local_path)
when giving path in local_c_includes
.
Comments
Post a Comment