-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Darwin collision of Point/Rect/Size types is still happening #19254
Copy link
Copy link
Closed
Description
System information (version)
- OpenCV => 4.5.1
- Operating System / Platform => macOS 11.1, iOS 14.3
- Compiler => Xcode 12.3, CMake 3.19.2
Detailed description
Either the old .framework or the new .xcframework won't compile with pure Swift project. The collision was supposed to be fixed by #18977. However it is still happening with both 4.5.1 and master branch (005508a). Example log:
/Users/x/Library/Developer/Xcode/DerivedData/opencv-test-fergxwbmhhedlzemnxjfnzmrvlbj/Build/Products/Debug-iphoneos/opencv2.framework/Modules/opencv2.swiftmodule/arm64-apple-ios.swiftinterface:29:122: error: ambiguous type name 'Size' in module 'opencv2'
@nonobjc public class func calibrateCamera(objectPoints: [opencv2.Mat], imagePoints: [opencv2.Mat], imageSize: opencv2.Size, cameraMatrix: opencv2.Mat, distCoeffs: opencv2.Mat, rvecs: inout [opencv2.Mat], tvecs: inout [opencv2.Mat], stdDeviationsIntrinsics: opencv2.Mat, stdDeviationsExtrinsics: opencv2.Mat, perViewErrors: opencv2.Mat, flags: Swift.Int32, criteria: opencv2.TermCriteria) -> Swift.Double
~~~~~~~ ^
opencv2.Size:1:12: note: found candidate with type 'Size'
open class Size : NSObject {
^
Darwin.Size:1:18: note: found candidate with type 'Size' (aka 'Int')
public typealias Size = Int
^
Steps to reproduce
- Build
xcframeworkaccording to platforms/apple/readme.md. - Create a new iOS Swift project in Xcode.
- Import
opencv2.xcframeworkfrom step 1 to the project. - Add
import opencv2in any of the.swiftfiles. - Build the project.
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
answers.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc
Reactions are currently unavailable