title: Referencing relative path resources from Android NDK manifest file
body: <p>I am currently having trouble including resources from the NDK manifest file and I am sure that it is a quick fix error. There are plenty of files that are shared between projects and operating systems in a large library.  Therefore, in order to keep the files up to date with other projects and keep from updating each individual project with the latest API each time an update occurs, a whole bunch of native header and source code files need to be referenced with relative paths.</p>
  
  <p>Within Eclipse, I have clicked and dragged across the files (without copying them, but by using a relative path) that would be needed by the current application in a local folder structure in the project.</p>
  
  <pre><p>/projectFolder
     /jni
        /externalProjectFiles
           /src
           /include
  </pre>
  
  <p>With this folder structure within Eclipse I have an Android.mk file with the following structure:</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_MODULE := projectLib
  
  LIBRARY_SRC_FOLDER   := $(wildcard $(LOCAL_PATH)/externalProjectFiles/src/*.cpp)
  
  LOCAL_C_INCLUDES := $(LOCAL_PATH)/externalProjectFiles/include
  
  LOCAL_SRC_FILES :=  projectLibNDK.c
  LOCAL_SRC_FILES +=  $(LIBRARY_SRC_FOLDER:$(LOCAL_PATH)/%=%)
  
  LOCAL_LDLIBS    := -L$(SYSROOT)/usr/lib -llog -landroid
  LOCAL_CFLAGS    :=  -Wno-multichar -D_ANDROID -DLIBDIR="\"c\"" 
  LOCAL_CFLAGS    +=  -DUSE_TCP_LOOPBACK -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" -DIN_LIBRARY -DBUILDING_LIBICONV -DUSE_BONJOUR 
  LOCAL_CFLAGS    +=  -DXR_TARGET_ANDROID -DKS_BUILDING_KS -Wno-psabi -Wno-multichar -D_GNU_SOURCE -DHAVE_IPV6=0 -DNOT_HAVE_SA_LEN 
  LOCAL_CFLAGS    +=  -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX
  LOCAL_CPPFLAGS  :=  -frtti -fexceptions
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>However, when I attempt to include the first header in the projectLibNDC.c it prints the error of <b>"No such file or directory"</b>.
  <p><code>#include "externalFile.h"</code></p>
  
  <p>Is the approach that I am taking a possible solution?  <br>
  Do I have to provide the relative paths in the Android.mk file itself for the files?  That would be a bit more of a hassle instead of referencing a local folder of referenced files.<br></p>
  
  <p>In theory, it sounds as though I would be able to create a library through the NDK in this manner.  But, perhaps I am not setting up the project properly.  Any aide would be helpful; JNI has a tendency to throw me around on occasion.<p></p>
  
  <p><b>EDIT:</b>  It would seem that Eclipse (which is an amazing IDE) does not have any glue behind the references to the linked files that it keeps in its project settings.  If I drag referenced files into the project, there are no physical files put into those folders to represent a linked files existence.  That information is only stored in project settings apparently.  Which is not helpful for the Android.mk file.<br><br>
  This means that any scripts or makefiles would not have any reference as to what files are supposed to be included.  Unfortunately, I will have to reference folders and files individually from the makefile itself.  I might leave the references in the project as a hint to their existence from other programmers.  Unfortunate that I cannot design it that way, but that is the conclusion that I have received thus far.</p>