title: Android NDK - Additional Include Directories
body: <p>I am using the Android NDK to build a shared library. I have include a snippet from my Android.mk file that is causing me a few issues.</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  ..#other module here
  ..#other module here
  
  include $(CLEAR_VARS)
  LOCAL_MODULE    := spatialite
  LOCAL_C_INCLUDES := ../../../projects/externalappsdk/include
  LOCAL_SRC_FILES := sqlite3.c \
  spatialite.c
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>My spatialite.c file includes some header files that are located in a folder that is external to the application project folder. I have included that folder in LOCAL_C_INCLUDES as shown above, but on running ndk-build, it still cannot locate these includes. What is the correct way of allowing the ndk-build command to identify where these includes are located. Any help will be greatly appreaciated.</p>
  
  <p>UPDATE:</p>
  
  <p>I wanted to add that spatialite itself need not be visible to the Java layer. I will thereafter be building another module which uses spatialite. I am not sure if this makes a difference to the way I declare the module on the Android.mk file.</p>
  
  <p>The compiler output is shown below:
  jni/spatialite.c:102:20: fatal error: geos_c.h: No such file or directory
   #include </p>
  
  <p>The .h file that is being imported in spatialite.c is located at C:/projects/externalappsdk/include. The spatialite.c and Android.mk are located at C:/mobile/myandroidproject/jni/</p>
  
  <p>The include directive within my spatialite.c file is shown below:</p>
  
  <pre><code>#ifndef OMIT_GEOS   /* including GEOS */
  #include &lt;geos_c.h&gt;
  #endif
  </code></pre>
  
  <p>ANSWER: 
  I managed to get this working using help from the answers provided by Chris which I have accepted. However, I had to make one change to the Android.mk file as is shown below:</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  include $(CLEAR_VARS)
  LOCAL_MODULE    := spatialite
  LOCAL_C_INCLUDES := ../../projects/externalappsdk/include
  LOCAL_SRC_FILES := sqlite3.c \
  spatialite.c
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>Note, that the LOCAL_C_INCLUDES goes two levels back instead of three.</p>