I wanted to make an OS X El Capitan application using OpenCV. I decided to use the latest version 3.0.0 released on June 4, 2015. I installed version 2.4.x using brew, but since version 3 now has a script construct for osx that creates the framework, I wanted to use this method.
After downloading version 3 from OpenCV.org, I opened a terminal window in the opencv-3.0.0 directory and executed the build_framework.py script as follows: platforms / osx / build _framework.py osx (The osx argument tells the script to make a directory called osx for output there framework)
Everything was built without a hitch, so I added the framework built into the osx directory to my project.
To my surprise, my project will not be built without errors. First of all, there were two of the following problems. Here is a screenshot of the first:

If the first problem did not appear, the error #ifndef __cplusplus # for each header file in opencv2.framework will be launched.

It turns out the problem was that the C ++ headers needed to be called before the Objective-C headers, so I added a PCH file to the project:

In fact, you can add this code to the header file, which needs the opencv.hpp header file, instead of creating a PCH file for the project. You should also be sure that #include, not #import, but they should work.
Once I understood these problems, I still stuck with 39 undefined characters for the x86_64 architecture.

, x86_64, , i386 x86_64 .
undefined , OpenCL. OpenCL opencv3. , , build_framework.py script , CMakeLists.txt. , OpenCL:
WITH_OPENCL
WITH_OPENCLAMDFFT
WITH_OPENCLAMDBLAS

, Mac OS X El Capitan OpenCL, , , . CMakeLists.txt, OpenCL, "AND NOT APPLE",
WITH_OPENCL
WITH_OPENCLAMDFFT
WITH_OPENCLAMDBLAS

CMakeLists.txt opencv2.framework( , opencv2 opencv3) .
, , , - , , OpenCV 3 Mac OS X. !