Android native code building with NDK -
i trying buikd android native module inside android build system using ndk. module builds out error while building android module make command. when try use ndk build setup facing problem android system include files. module structure :
android | external | mymodule | jni --> android.mk mysharedobj --> android.mk
my native module includes many android includes such as
#include <jnihelp.h> #include "android_runtime/androidruntime.h" #include <gui/surface.h> #include <gui/isurface.h>
with of ndk docs able resolve include errors, facing somre error, eg:
jni/com_my_module_nativeinterface.cpp:3:21: fatal error: jnihelp.h: no such file or directory compilation terminated.
-->for resolving jnihelp.h include error, had added following line in android.mk
local_c_includes += \ $(local_path)/../../../libnativehelper/include/nativehelper
after again 1 more error,
jni/../../../libnativehelper/include/nativehelper/jnihelp.h:27:24: fatal error: cutils/log.h: no such file or directory compilation terminated.
--> solve above error had modified android.mk
local_c_includes += \ $(local_path)/../../../libnativehelper/include/nativehelper \ $(local_path)/../../../system/core/include \
after again 1 more error
/home/user/android-ndk-r8e/platforms/android-3/arch-arm/usr/include/linux/uio.h:18:8: error: redefinition of 'struct iovec' jni/../../../system/core/include/cutils/uio.h:33:8: error: previous definition of 'struct iovec'
how build native module uses android system include files? please me.
i'm not sure, try put flag -dhave_sys_uio_h on local_cflags:
local_cflags += -dhave_sys_uio_h
Comments
Post a Comment