Many people provide the solution in Objective-c by renaming .m to .mm. But how to solve it in Swift?
Asked
Active
Viewed 1,142 times
3 Answers
2
I ran across this problem recently converting an Obj-C program to a hybrid one with Swift / Obj-C. I was fully aware of the 'm' / 'mm' issue so that wasn't my problem.
What caused this issue for me was that I had put an include file in the 'bridging' header that referred to OpenCV - both the the #include file and some definitions. Whoops.
Answer: Check to see if your bridging #include file somehow references opencv - remove.

Peter Gaston
- 176
- 13
-
I believe this is my issue too. If this is the case how do you pass an Object processed by OpenCV back to swift without causing this clash? – Cornell Skyers Dec 06 '16 at 18:23
0
In my case, the problem was the import line in prefix header file. After removing this import, my problem solved

Ozgur Sahin
- 1,305
- 16
- 24
0
I ran into this problem while working with opencvframework. I fixed this issue by adding #import opencv2/opencv.hpp in objective c .h files. This might be help you!

Hafiz Muhammad Farooq Rasheed
- 121
- 1
- 6