0

I am very beginner to android native programming. I know this is very basic question, but still i could not solve this. Please support me. I have some set of header files residing remotely(not in local_path). But i have included it under includes tree. I am trying to include this header file in a c file present in jni/sample.c Now the problem is that these header files are not recognized. (It shows "unresolved inclusion..etc"). Is this anything related to android.mk file? I did not mention remote header files path anywhere in android.mk file

Nikesh Devaki
  • 2,091
  • 2
  • 16
  • 24

1 Answers1

0

you have to add the path to these header files to LOCAL_C_INCLUDES variable you can set inside Android.mk (as you rightly guessed):

LOCAL_C_INCLUDES += ./path/to/your/includes
ph0b
  • 14,353
  • 4
  • 43
  • 41
  • @phOb I have NDK in F:/android-ndk-r10\ And my project in F:/android-ndk-r10\samples\AndroidKeyInjector Includes in F:\android-ndk-r10\platforms\android-5\arch-arm\usr\include Then what would be path for includes – Nikesh Devaki Aug 11 '14 at 16:24
  • The /usr/include directory of the platform you're compiling against is automatically included, you don't need to add it. If your includes are under AndroidKeyInjector/Includes then you can add `LOCAL_C_INCLUDES += ../Includes` – ph0b Aug 11 '14 at 16:42
  • Thank you. I have edited it, but still header files in jni/sample.c are not recognized. Is this something related to NDK setup? Actually, I imported this project from external source – Nikesh Devaki Aug 11 '14 at 16:53
  • This was the project I imported http://www.pocketmagic.net/wp-content/uploads/2012/04/AndroidKeyInjector.zip – Nikesh Devaki Aug 11 '14 at 16:58
  • which header files aren't recognized ? – ph0b Aug 11 '14 at 17:44
  • Every header file in input.c,uinput.h in jni folder (in above project) are not recognized. I guess it may be because of ndk set setup. Thank you so much for replying – Nikesh Devaki Aug 12 '14 at 06:36
  • Could you please tell me whether project mentioned in above link works fine? I am stuck with this since 4 days. I would be grateful to you if you could help me – Nikesh Devaki Aug 12 '14 at 16:06