Android ndk 在android ndk中包含外部库libxml2时出现未定义的引用错误

Android ndk 在android ndk中包含外部库libxml2时出现未定义的引用错误,android-ndk,libxml2,Android Ndk,Libxml2,我正在尝试将libxml2与android ndk一起使用。当我运行make文件时,我收到错误消息,说文件“unicode/ucnv.h”不存在。我看到其中一个文件中包含了“unicode/ucnv.h”,但没有这样的头文件。所以我从下载了unicode头文件,并将它们放在include文件夹中 现在前面的错误消失了,但我有这些错误 共享库:libxml2.so ./obj/local/armeabi/objs-debug/xml2/encoding.o: In function `openIc

我正在尝试将libxml2与android ndk一起使用。当我运行make文件时,我收到错误消息,说文件“unicode/ucnv.h”不存在。我看到其中一个文件中包含了“unicode/ucnv.h”,但没有这样的头文件。所以我从下载了unicode头文件,并将它们放在include文件夹中

现在前面的错误消失了,但我有这些错误

共享库:libxml2.so

./obj/local/armeabi/objs-debug/xml2/encoding.o: In function `openIcuConverter':
C:\test\hello-jni/jni/encoding.c:109: undefined reference to `ucnv_open_49'
C:\test\hello-jni/jni/encoding.c:115: undefined reference to `ucnv_setToUCallBack_49'
C:\test\hello-jni/jni/encoding.c:119: undefined reference to `ucnv_setFromUCallBack_49'
C:\test\hello-jni/jni/encoding.c:126: undefined reference to `ucnv_open_49'
C:\test\hello-jni/jni/encoding.c:132: undefined reference to `ucnv_close_49'
C:\test\hello-jni/jni/encoding.c:135: undefined reference to `UCNV_TO_U_CALLBACK_STOP_49'
C:\test\hello-jni/jni/encoding.c:135: undefined reference to `UCNV_FROM_U_CALLBACK_STOP_49'
./obj/local/armeabi/objs-debug/xml2/encoding.o: In function `closeIcuConverter':
C:\test\hello-jni/jni/encoding.c:141: undefined reference to `ucnv_close_49'
C:\test\hello-jni/jni/encoding.c:142: undefined reference to `ucnv_close_49'
./obj/local/armeabi/objs-debug/xml2/encoding.o: In function `xmlUconvWrapper':
C:\test\hello-jni/jni/encoding.c:1865: undefined reference to `ucnv_convertEx_49'
C:\test\hello-jni/jni/encoding.c:1870: undefined reference to `ucnv_convertEx_49'
collect2:ld返回了1个退出状态 make:[obj/local/armeabi/libxml2.so]错误1

我在任何文件中都没有找到函数ucnv_open_49。 我是唯一面临这个问题的人吗?

与libxml2一起构建unicode库(icu),并在本地共享库中提及。
就这样

您是否打算将libxml2链接到ICU(例如,将其用于转换)?它是可选的,但当前已启用。有了这些,你就需要把ICU连接起来,而不是静态的或动态的。有关选项,请参阅libxml2的配置脚本。如果您只打算使用UTF-8,其中一些是iconv或甚至没有转换器。

我不知道您的意思是什么?当然,Cygwin和Mintty终端可以显示Unicode。但这并不能让你通过你的问题。Libxml2需要配置a)使用另一个转换器而不是ICU,如iconv,b)禁用转换器,或c)与ICU链接。这些选项中的任何一个都可以根据您的需要解决您的问题。