【问题标题】:Binding brother printer SDK framework to xamarin ios binding library绑定兄弟打印机SDK框架到xamarin ios绑定库
【发布时间】:2018-07-10 09:41:47
【问题描述】:

我正在尝试使用兄弟打印机移动 sdk for ios (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.

【问题讨论】:

    标签: objective-c binding xamarin.ios frameworks


    【解决方案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。 (右键单击框架并选择属性)

    【讨论】:

      【解决方案2】:

      感谢@jgoldberger

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

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-11
      • 2018-08-02
      • 2016-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多