-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Unable to import Swift framework due to name conflicts with NS_SWIFT_NAME(pow) #21725
Copy link
Copy link
Closed
Closed
Copy link
Milestone
Description
System information (version)
- OpenCV => 4.5.5
- Operating System / Platform => macOS 12.2.1
- Compiler => Xcode 13.2.1
Detailed description
Importing OpenCV framework to Swift fails with the error "Too few arguments provided to function-like macro invocation". Upon further inspection it appears that the NS_SWIFT_NAME macro used for the function pow is encountering a conflict with the global macro pow.
Steps to reproduce
- Download the iOS pack from the OpenCV 4.5.5 release
- Add it to an Xcode project
- Add an
import opencv2file to a Swift file - Try to build the project
Encounter the error:
opencv2.framework/Headers/Core.h:2524:89: Too few arguments provided to function-like macro invocation
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk/usr/include/tgmath.h:495:9: Macro 'pow' defined here
Could not build Objective-C module 'opencv2'
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found any solution - I updated to the 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