Reputation: 817
I am configuring NDK for an android app which makes use of the linux/input.h file in its header - #include . The issue is when I call ndk-build, it gives an error which basically implies that it cannot find linux/input.h. Now, cygwin does not contain the linux directory, which is probably why this error is occuring but the ndk does contain it - android-ndk-r8e\platforms\android-14\arch-x86\usr\include\linux\input.h - shouldn't ndk-build search here as well? To give some more context, I am trying to compile the EventInjector library described here and others seem to have it working, which means it must be possible somehow.
Upvotes: 1
Views: 542
Reputation: 5379
Please follow these instructions:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) TARGET_PLATFORM := android-8 LOCAL_MODULE := your_lib LOCAL_SRC_FILES := my_file.c LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog include $(BUILD_SHARED_LIBRARY)</li>
my_file.c will be your source file name that is present in JNI folder
Right click on project Choose Properties>Builders Click on New... Select Program, then Ok In main tab: Give your Builder a suitable name, eg. "NDK" For Location, click on Browse file system>select your ndk-build.cmd, eg. C:\android-ndk-r8-windows\android-ndk-r8\ndk-build.cmd (My NDK path) Below there will be Working Directory: Click on: Browse workspace - choose your project, eg. ${workspace_loc:/Test} (My project 'Test') Click on **Refresh Tab** Select **Specific Resources** radio button Click on **Specify Resources..** Select libs folder from your project Now click on **Build Options** Tab Check: After a Clean During manual builds During auto builds Specify working set of relevant resources Click on **Specify Resources...** Select JNI folder of your project Click Apply...Ok
Now clean it and build...then refresh
You will get your_lib.so in libs>armeabi libs>armeabi>your_lib.so this structure will create automatically ....
Upvotes: 1