将Brother打印机SDK框架绑定到Xamarin iOS绑定库

时间:2018-07-10 09:41:48

标签: objective-c binding xamarin.ios frameworks

我正在尝试使用适用于ios的兄弟打印机移动sdk(BRPtouchPrinterKit.framework)创建一个xamarin.ios绑定库。

当您使用“ / Users / [用户名] /Desktop/BrotherPrinterSDK/bpsdkBinding/bpsdkBinding/BRPtouchPrinterKit.framework/Versions/A/”下的“ BRPtouchPrinterKit”时,Xamarin.iOS绑定项目可以正确编译和构建。在Mac中。

当我尝试在示例中使用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.

2 个答案:

答案 0 :(得分:1)

我相信您的问题与SO上的问题相同: Linking failure with a MonoTouch native library binding

在这种情况下,您需要添加对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。 (右键单击框架,然后选择属性)

答案 1 :(得分:0)

感谢@jgoldberger

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