Ask Your Question
0

Xcode6.3.2 __cplusplus notdefine

asked 2015-06-09 03:46:08 -0500

this is the error, in opencv2.framework/Headers/core.hpp line 49

image description

my xcode build setting is

image description

image description

image description

edit retag flag offensive close merge delete

Comments

I had the same problem but I was not able to solve it. Did you solve it?

Thanks and regards, Giordano

Giordano gravatar imageGiordano ( 2015-07-31 04:34:22 -0500 )edit

It means that basically your environment does not find the cpp compiler, which is obviously mandatory for the cpp functionality...

StevenPuttemans gravatar imageStevenPuttemans ( 2015-07-31 05:57:06 -0500 )edit

ok, but if I start a new iOS project from scratch all is working. I have this problem only with an existing project. If the environment doesn't find the cpp compiler how can I setup it?

Thanks and regards, Giordano

Giordano gravatar imageGiordano ( 2015-07-31 07:26:00 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-06-15 01:34:18 -0500

Tamajit gravatar image
  1. first follow this to create prefix file (YourPrefixFileName.pch)
  2. add this code to your prefix file

    #ifdef __cplusplus
    #import <opencv2/opencv.hpp>
    #endif
    
    #ifndef YourProjectName_YourPrefixFileName_pch
    #define YourProjectName_YourPrefixFileName_pch
    
    // Include any system framework and library headers here that should be included in all compilation units.
    // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
    
    #endif
    
  3. rename your ViewController's extension from .m (ViewController.m) to .mm (ViewController.mm)
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-06-09 03:46:08 -0500

Seen: 216 times

Last updated: Jul 31 '15