3

Getting error from "opencv2.framework". Just a new project contained "opencv2.framework" not running.

My Steps:

  1. download latest opencv2.framework
  2. add required frameworks
  3. declare .pch file stuff
  4. changed .m file -> .mm

Am I missing something?

enter image description here

#ifndef PrefixHeader_pch
#define PrefixHeader_pch

#import <Availability.h>

#ifndef __IPHONE_4_0
#warning "This project uses features only available in iOS SDK 4.0 and later."
#endif

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

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif

#endif /* PrefixHeader_pch */

enter image description here

Ofir Malachi
  • 1,145
  • 14
  • 20

1 Answers1

10

Line 46 says it all: You have to put opencv.hpp before any Apple's headers. In PrefixHeader.pch move

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

up and before

#import <Availability.h>
Quang Hoang
  • 146,074
  • 10
  • 56
  • 74