title: libxml2 with Android NDK
body: <p>I'm trying to run libxml2 from the Android NDK (for porting of various code from iPhone). 
  I've managed to get the basic code to compile and recognize the libxml header files but I can't use any method (I get <code>undefined reference</code> errors)</p>
  
  <p>From what I've figured out it's because the NDK isn't really linking the libxml library - so all the headers from the .h files work but the methods aren't really there.</p>
  
  <p>Anyone have success doing this in the past?</p>
  
  <p>This is the current Android.mk file</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_MODULE    := xpathParser
  LOCAL_SRC_FILES := xpathParser.c
  
  LOCAL_C_INCLUDES += /Developer/SDKs/MacOSX10.6.sdk/usr/include/libxml2
  
  LOCAL_CFLAGS    := -Werror
  LOCAL_LDLIBS := -ldl -llog
  LOCAL_STATIC_LIBRARIES := -llibxml2
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>And the C code:</p>
  
  <pre><code>JNIEXPORT void JNICALL Java_com_mycompany_libxmltest_LibXMLTest_nativeInit(JNIEnv * env, jobject obj)
  {   
      xmlDocPtr doc;
      xmlXPathContextPtr xpathCtx; 
      xmlXPathObjectPtr xpathObj; 
      const char* filename;
  
  #if defined(LIBXML_XPATH_ENABLED) &amp;&amp; defined(LIBXML_SAX1_ENABLED)
      LOGD("---- LIBXMLTEST ---- HAS LIBXML!  %d",XML_PARSE_RECOVER);
  
      /* THESE ARE ALL UNDEFINED REFERENCES WHEN COMPILED */
      xmlInitParser();
      xmlFreeDoc(doc); 
      xmlLineNumbersDefault(1);
  #else
          LOGD("---- LIBXMLTEST ---- CAN'T FIND LIBXML!");
  #endif
  
  }
  </code></pre>