Home xcode prefix header build error for opencv
Reply: 0

xcode prefix header build error for opencv

Teja Nandamuri
1#
Teja Nandamuri Published in 2018-02-13 18:42:15Z

I'm trying to add opencv framework to my project, and I'm unable to build successfully.

Here is my .pch

#ifdef __cplusplus
#import <opencv2/opencv.hpp>
#endif

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
#import <FMDB/FMDB.h>
#import <SAMKeychain/SAMKeychain.h>
#import <Realm/Realm.h>
#endif

// cocoa lumberjack logging
#define LOG_LEVEL_DEF ddLogLevel
#import <CocoaLumberjack/CocoaLumberjack.h>
#import <BadgeLabel/BadgeLabel.h>

static const DDLogLevel ddLogLevel = DDLogLevelVerbose;

and I get the error:

Expected identifier or (...

in file included from /..../..../.pch : 14

This error only happens when I changed one class extension from .m to .mm. I need to change that class extension as I'm using opencv methods in that class.

If I dont use the opencv code in my ImageManager class, and change back the extension from .mm to .m, then it builds successfully.

ImageManager.h:

#import <Foundation/Foundation.h>
#import <opencv2/videoio/cap_ios.h>

@interface ImageManager : NSObject

@end

Here is the ImageManager.mm

#import "ImageManager.h"
@implementation ImageManager

@end
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.490222 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO