作者:可怜小淖_135 | 来源:互联网 | 2023-09-24 14:22
IamusingtheOpenCViOSFrameworkinaproject.Ifollowedthenecessarystepstoincludethefram
I am using the OpenCV iOS Framework in a project. I followed the necessary steps to include the framework into the project.
我正在一个项目中使用OpenCV iOS框架。我遵循了必要的步骤,将框架包含到项目中。
The Project is written using Swift 3.
项目是使用Swift 3编写的。
One of my classes that contains the core functionality of the App is written in Objective-C++. I included the header of the class in my Bridge-header file but when trying to run the project I get the following error:
我的一个类包含应用程序的核心功能,它是用objective - c++编写的。我将类的header包含在我的Bridge-header文件中,但是在尝试运行项目时,我得到以下错误:
error core.hpp header must be compiled as C++
错误的核心。hpp头必须被编译成c++。
After researching online and on SO, the most common solution presented was to create a Wrapper class that would be imported in the bridge header. However, after following this article I face the same problem.
在线研究之后,最常见的解决方案是创建一个包装类,该类将被导入到桥头中。然而,在阅读本文之后,我面临着同样的问题。
The Header file of my class looks like this:
我的类的头文件是这样的:
#if TARGET_OS_IPHONE
#import
#define IMAGE_CLASS UIImage
#elif TARGET_OS_MAC
#import
#define IMAGE_CLASS NSImage
#endif
#import
#import
#import
#import
typedef void (^DebugBlock)(cv::Mat current_image, std::string current_image_name);
@interface ImageScanner : NSObject
/**
* Singleton for access to the scanner.
*
* @return Shared scanner.
*/
+ (instancetype)sharedScanner;
Does anyone have an idea what I might be missing?
有没有人知道我可能会错过什么?
Thank you in advance! G.
提前谢谢你!G。
1 个解决方案