4

I want to use openCV in my iOS 8 App. But there is a problem. I`ve updated my xCode to version 6.0.1 and there is my problem:

I imported openCV using this easy tutorial: http://docs.opencv.org/doc/tutorials/ios/hello/hello.html#opencvioshelloworld

After update everything crashes on the 2nd step: "Open the file named NameOfProject-Prefix.pch ..." there is no file with .pch suffix in my project.

Can you help me please?

Miki Stuchlej
  • 127
  • 1
  • 6
  • Just include directly in the C++ classes or Objective-C++ classes that use them directly. Also see [Why isn't ProjectName-Prefix.pch created automatically in Xcode 6?](http://stackoverflow.com/questions/24158648/why-isnt-projectname-prefix-pch-created-automatically-in-xcode-6). – Joe Oct 14 '14 at 19:44
  • Did you ever get this working? I need to get OpenCV working in the latest version as well. I'll trace your steps. If you got it working, a little help would be appreciated. :-) OK. Actually, I have already included these steps...my issue is not with an application, but with a Universal Framework. This script will not work and I have no clue why. – Patricia Oct 28 '14 at 19:05

1 Answers1

6

I struggled with that also but i finally solved it.

Just add

#import <opencv2/opencv.hpp>

to every header where you need it. Don't forget to rename your classes from .m to .mm to make it run. To use the framework in your c++ files just include it.

As Joe mentioned, have a look at this page.

Happy coding!

Community
  • 1
  • 1
Tomte
  • 1,237
  • 12
  • 18