Ask Your Question

Revision history [back]

How to build OpenCV for Xcode 6.1.1 - __cplusplus not defined

I'm having an issue running an xcode project with OpenCV. I've followed the instructions on this page to build the OpenCV framework for iOS. Then I followed this tutorial to build a test app.

But when I try to build, it looks like __cplusplus is not defined since

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

is not executed.

I can't seem to get my project to compile c++ files that would get this to work. Any pointers would be much appreciated.

I've made sure that my build settings knows of the .pch file, and double checked that the framework was added.

I'm on OS X Yosemite 10.10.1, Xcode 6.1.1, and the type of application I created was Single View Application