Ask Your Question
0

How to build OpenCV for Xcode 6.1.1 - __cplusplus not defined

asked 2015-02-03 17:45:35 -0600

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

edit retag flag offensive close merge delete

Comments

Did you create a cpp project? It seems that your compile doesnt know he needs to build C++ software...

StevenPuttemans gravatar imageStevenPuttemans ( 2015-02-04 03:08:40 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-04-07 06:06:59 -0600

geekay gravatar image

In your Project Settings check the following compilers used. Apple LLVM 6.0 Language - C++

image description

And

image description

I hope this helps you.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-02-03 17:45:35 -0600

Seen: 684 times

Last updated: Feb 03 '15