0

I'm trying to compile the PugiXML library with Android NDK; it says on the website that this is possible, but the download doesn't contain an android makefile and I haven't used NDK much before (the docs don't help!)

I'm currently getting the error:

/pugiconfig.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status

I was originally getting an error because NDK couldn't find #include <iterator> and I'm not sure I've correctly resolved this. I tried following this stackoverflow Q/A and ended up with the error shown above.

My current Android.mk looks like this:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := webface
LOCAL_CPP_EXTENSION := .hpp .cpp
LOCAL_SRC_FILES := ../pugiconfig.hpp ../pugixml.hpp ../pugixml.cpp

include $(BUILD_SHARED_LIBRARY)

and my current Application.mk looks like this:

APP_ABI := all
APP_STL := stlport_shared
Community
  • 1
  • 1
jProg2015
  • 1,098
  • 10
  • 40
  • I'd suggest removing everything but pugixml.cpp from LOCAL_SRC_FILES. Also, note that if you have issues with you can just compile with PUGIXML_NO_STL (probably by adding -DPUGIXML_NO_STL to CXXFLAGS). – zeuxcg Sep 26 '15 at 08:02
  • Removing everything but the .cpp worked; if you want to add it as an answer I will mark it correct :) – jProg2015 Sep 26 '15 at 12:22

1 Answers1

0

I'd suggest removing everything but pugixml.cpp from LOCAL_SRC_FILES.

Also, note that if you have issues with you can just compile with PUGIXML_NO_STL (by adding -DPUGIXML_NO_STL to CXXFLAGS).

zeuxcg
  • 9,216
  • 1
  • 26
  • 33