将brother printer SDK框架绑定到xamarin ios绑定库



我正在尝试使用兄弟打印机mobile sdk for ios(BRPtouchPrinterKit.framework(创建一个xamarin.ios绑定库。

当您在mac中使用"/Users/[username]/Desktop/BrowthPrinterSDK/bpsdkBinding/bpsdkBinding/BRPtouchPrinterKit.framework/Versions/A/"下的"BRPtouchPrinterKit"时,Xamarin.iOS绑定项目编译和构建不会出错。

当我尝试在示例中使用dll时,以及当我尝试运行相同的dll时,我在运行时会遇到以下错误。

clang : error : linker command failed with exit code 1 (use -v to see invocation)
MTOUCH : error MT5210: Native linking failed, undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find(char, unsigned long) const. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(unsigned long, unsigned long, char const*, unsigned long) const. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: std::__1::__shared_weak_count::__get_deleter(std::type_info const&) const. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: std::__1::__vector_base_common<true>::__throw_length_error() const. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: std::__1::__basic_string_common<true>::__throw_length_error() const. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.

我相信您的问题与SO上的问题相同:MonoTouch本机库绑定链接失败

在这种情况下,您需要添加对libc++(-lc++(的引用,并确保将IsCxx标志设置为true。这可以在你的绑定项目中的linkwith.cs文件中完成,如上面的帖子所示,例如:

[assembly: LinkWith (... LinkerFlags = "-lc++ [and you may have some other -l* libs listed here here already]", IsCxx = true)]

如果您没有linkwith.cs文件,那么您应该能够添加上面对-lc++的引用,并在框架的属性中将IsCxx标志设置为true。(右键单击框架并选择"属性"(

感谢@jgoldberger

对于任何可能遇到相同问题的人,请浏览链接https://forums.xamarin.com/discussion/comment/340581

最新更新