I'm trying to build a Swift framework that includes C++ and OpenCV Framework for iOS
As far as I understand we can't have a bridging header in framework, we have to deal with umbrella header.
My issue is that XCode is not processing C++ file as C++, with that kind of compiler error :
Unknown type name 'class'; did you mean 'Class'?
It also cannot find <iostream>
I currently have my umbrella that is including a objc wrapper for my C++ files.
What is the right way to do it ?
Below my framework umbrella header
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#include <iostream>
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "AGImageDescriptor.h"
#import "AGKitLib.h"
#import "Detector.h"
#import "Observable.h"
#import "Shooter.h"
#import "DocumentDetectedState.hpp"
#import "DocumentMatchState.hpp"
#import "GoodPerspectiveState.hpp"
#import "GoodPositionState.hpp"
#import "InactiveState.h"
#import "ReadyState.hpp"
#import "StartState.h"
#import "State.h"
#import "States.h"
#import "TextDetectedState.hpp"
#import "Tools.hpp"
#import "OpenCVWrapper.h"
#import "UIImage+OpenCV.h"
FOUNDATION_EXPORT double AGKitScanVersionNumber;
FOUNDATION_EXPORT const unsigned char AGKitScanVersionString[];
I am really not an C++ expert nor a C expert so I am probably missing something here.