简体   繁体   English

使用绑定项目将本机库libxml2链接到xamarin.ios项目

[英]linking native library libxml2 into xamarin.ios project with binding project

I have an xcode code that uses the library libxml2.tbd I needed to make that code a static library (myProjectLib.a) that can be used inside Xamarin.ios following this official guidelines: Binding iOS Library 我有一个xcode代码,使用库libxml2.tbd我需要使该代码成为一个静态库(myProjectLib.a),可以在Xamarin.ios中使用遵循以下官方指南: 绑定iOS库

The problem is that I get alot of errors about undefined symbols while building the xamarin project as if the project can't link libxml2 问题是我在构建xamarin项目时遇到很多关于未定义符号的错误,好像项目无法链接libxml2

Error MT5210: Native linking failed, undefined symbol: _xmlTextWriterFlush. 错误MT5210:本机链接失败,未定义符号:_xmlTextWriterFlush。 Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in 请验证是否已引用所有必需的框架,并且本机库已正确链接

I did this binding successfully several times but only without dependency library. 我成功地做了几次绑定,但只有没有依赖库。 but there must be a solution to link it. 但必须有一个解决方案来链接它。

things that I already tried : 我已经尝试过的事情:
-adding libxml2.dylib into the xcode library project (same error in xamarin) - 将libxml2.dylib添加到xcode库项目中(xamarin中的相同错误)
-adding (-libxml2,-lxml2) into other linker flags in xcode library project (same error in xamarin) -adding(-libxml2,-lxml2)到xcode库项目中的其他链接器标志(xamarin中的相同错误)
-adding the libxml2.dylib file into xamarin binding project, xamarin app project resources with always copy options (same error in xamarin) - 将libxml2.dylib文件添加到xamarin绑定项目中,使用始终复制选项的xamarin app项目资源(xamarin中的相同错误)

last tried: 上次尝试:
-adding --gcc_flags="-stdlib=libxml2" into (Additional mtouch arguements) in xamarin app project, gave another error that the name is not valid -adding --gcc_flags =“ - stdlib = libxml2”进入(附加mtouch争论)xamarin app项目中,给出了另一个错误,即该名称无效

Error MT5209: Native linking error: clang: error: invalid library name in argument '-stdlib=libxml2' 错误MT5209:本机链接错误:clang:错误:参数'-stdlib = libxml2'中的库名无效

Add -lxml2 to linker flags in the properties of the native library that is added as a native reference in the iOS binding project. -lxml2添加到本机库属性中的链接器标志,该库作为iOS绑定项目中的本机引用添加。 It should look like this. 它看起来应该是这样的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM