私は長い間同じ問題を抱えていましたが、今、回避策を発見しました。あなたが正しく述べたように、それはUIKitのNO-makroの定義に問題があります。あなたがする必要があるのはあなたの.pchファイルに行きそして置き換えることです
#ifdef __cplusplus
#import <opencv2/opencv.hpp>
#endif
と
#ifdef __cplusplus
#import <opencv2/opencv.hpp>
#import <opencv2/stitching/detail/blenders.hpp>
#import <opencv2/stitching/detail/exposure_compensate.hpp>
#endif
したがって、結果の.pchは次のようになります。
//
// Prefix header for all source files of the 'Project' target in the 'Project' project
//
#import <Availability.h>
#ifndef __IPHONE_3_0
#warning "This project uses features only available in iOS SDK 3.0 and later."
#endif
#ifdef __cplusplus
#import <opencv2/opencv.hpp>
#import <opencv2/stitching/detail/blenders.hpp>
#import <opencv2/stitching/detail/exposure_compensate.hpp>
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
このようにして、blenders.hppとexposure_compensate.hppのNO列挙型は、UIKitのNO-makroの前に定義されます。