以前我手动进行了 Card.IO 绑定。它正在编译,使用它的项目也在编译,但它会经常崩溃。
现在我正在尝试使用 ObjectiveSharpie 从头开始重新创建绑定。绑定项目可以编译,但是当我从另一个项目中引用它时,会出现如下所示的编译器错误。
它将 AVFoundation 框架项目显示为“未定义的符号...”,因此在 Xamarin 的 IOS 构建选项下,我有“-cxx”选项。我尝试了各种方法组合将框架添加到项目中: - 在 CardIO 绑定项目中修改了 [assembly: LinkWith(..., Frameworks="...")]。这导致我的主项目中无法识别 CardIO 命名空间 - 添加了 -gcc_flags “-framework ...”。这导致来自编译器的“找不到框架”消息我最终通过包含 a 来解决 AVFoundation using AVFoundation
,然后请求一个的类型名称(如果它的类),这样链接器就不会对其进行优化 - 我书中的丑陋黑客。
在下面的错误中,似乎缺少更多框架,除此之外,我认为std::...
应该使用“-cxx”参数解决这些问题
我不知道如何使此绑定编译并正常工作。
Undefined symbols for architecture armv7:
"_AudioServicesPlayAlertSound", referenced from:
-[CardIOCameraViewController vibrate] in libCardIO.a(CardIOCameraViewController.o)
"_CMGetAttachment", referenced from:
-[CardIOVideoStream captureOutput:didOutputSampleBuffer:fromConnection:] in libCardIO.a(CardIOVideoStream.o)
"_CMSampleBufferGetImageBuffer", referenced from:
-[CardIOVideoFrame process] in libCardIO.a(CardIOVideoFrame.o)
"_CVPixelBufferGetBaseAddressOfPlane", referenced from:
+[CardIOIplImage imageFromYCbCrBuffer:plane:] in libCardIO.a(CardIOIplImage.o)
"_CVPixelBufferGetBytesPerRowOfPlane", referenced from:
+[CardIOIplImage imageFromYCbCrBuffer:plane:] in libCardIO.a(CardIOIplImage.o)
"_CVPixelBufferGetHeightOfPlane", referenced from:
+[CardIOIplImage imageFromYCbCrBuffer:plane:] in libCardIO.a(CardIOIplImage.o)
"_CVPixelBufferGetWidthOfPlane", referenced from:
+[CardIOIplImage imageFromYCbCrBuffer:plane:] in libCardIO.a(CardIOIplImage.o)
"_CVPixelBufferLockBaseAddress", referenced from:
-[CardIOVideoFrame process] in libCardIO.a(CardIOVideoFrame.o)
"_CVPixelBufferUnlockBaseAddress", referenced from:
-[CardIOVideoFrame process] in libCardIO.a(CardIOVideoFrame.o)
"_OBJC_CLASS_$_EAGLContext", referenced from:
objc-class-ref in libCardIO.a(CardIOGPURenderer.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find(char const*, unsigned long, unsigned long) const", referenced from:
cv::CommandLineParser::CommandLineParser(int, char const* const*, char const*)in libCardIO.a(cmdparser.o)
(anonymous namespace)::split_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)in libCardIO.a(cmdparser.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find(char, unsigned long) const", referenced from:
cv::CommandLineParser::CommandLineParser(int, char const* const*, char const*)in libCardIO.a(cmdparser.o)
(anonymous namespace)::del_space(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)in libCardIO.a(cmdparser.o)
cv::CommandLineParser::printParams() in libCardIO.a(cmdparser.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::rfind(char, unsigned long) const", referenced from:
(anonymous namespace)::del_space(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)in libCardIO.a(cmdparser.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(char const*) const", referenced from:
cv::CommandLineParser::CommandLineParser(int, char const* const*, char const*)in libCardIO.a(cmdparser.o)
cv::CommandLineParser::printParams() in libCardIO.a(cmdparser.o)
bool cv::CommandLineParser::get<bool>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)in libCardIO.a(cmdparser.o)
"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from: