0

I have added opencv framework through cocoapods. I added required frameworks to Linked Frameworks and Libraries as well.

As, I am using Swift. So, I made a bridging header with "Wrapper" NSObject in Objective C. Problem is that when I try to import these in Wrapper.h, it gives me error

#import <opencv2/opencv.hpp>
#import <opencv2/imgcodecs/ios.h>

Error is:

Could not build module 'opencv2'

Where as if I import them in Wrapper.mm they work fine. Kindly tell me how to use them in header file. As I need to call a few variables from header file.

1 Answer 1

1

When bridging header files to Swift, the files have to be pure Objective-C++. So you cannot include any opencv headers in Wrapper.h, they have to go in Wrapper.mm. For more detail how to write and use a wrapper, see my answer here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.