【问题标题】:Compiling PugiXML with Android NDK使用 Android NDK 编译 PugiXML
【发布时间】:2015-09-25 20:59:25
【问题描述】:

我正在尝试使用 Android NDK 编译 PugiXML 库;它在网站上说这是可能的,但下载不包含 android makefile,而且我以前没有使用过 NDK(文档没有帮助!)

我目前收到错误:

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

我最初收到一个错误,因为 NDK 找不到 #include <iterator>,我不确定我是否正确解决了这个问题。我尝试关注this stackoverflow Q/A,结果出现如上所示的错误。

我当前的 Android.mk 如下所示:

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)

我当前的 Application.mk 看起来像这样:

APP_ABI := all
APP_STL := stlport_shared

【问题讨论】:

  • 我建议从 LOCAL_SRC_FILES 中删除除 pugixml.cpp 之外的所有内容。另外,请注意,如果您对 有疑问,您可以使用 PUGIXML_NO_STL 进行编译(可能通过将 -DPGIXML_NO_STL 添加到 CXXFLAGS)。
  • 删除除 .cpp 之外的所有内容;如果您想将其添加为答案,我会将其标记为正确:)

标签: android makefile android-ndk pugixml


【解决方案1】:

我建议从 LOCAL_SRC_FILES 中删除除 pugixml.cpp 之外的所有内容。

另外,请注意,如果您遇到问题,可以使用 PUGIXML_NO_STL 进行编译(通过将 -DPUGIXML_NO_STL 添加到 CXXFLAGS)。

【讨论】:

    猜你喜欢
    • 2014-05-03
    • 2011-10-25
    • 2014-02-14
    • 2011-08-15
    • 2011-07-09
    • 1970-01-01
    • 1970-01-01
    • 2014-09-11
    • 2011-09-29
    相关资源
    最近更新 更多