# Build OpenCV Framework - Mac osx error

**URL:** <https://forum.opencv.org/t/build-opencv-framework-mac-osx-error/2357>\
**Category:** Uncategorized\
**Tags:** build, apple\
**Created:** [March 25, 2021, 11:09am UTC](https://forum.opencv.org/t/build-opencv-framework-mac-osx-error/2357 "2021-03-25T11:09:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LisaG](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@LisaG](https://forum.opencv.org/u/LisaG)\
**Post date:** [March 25, 2021, 11:09am UTC](https://forum.opencv.org/t/build-opencv-framework-mac-osx-error/2357/1 "2021-03-25T11:09:53Z")

</div>

Hi there,

I’m completely new to OpenCV and so yesterday I with installing it. I didn’t want to use Homebrew to install it on my Mac but I wanted to use the method of building the frameworks. I did this successfully for the framework for iOS but I cannot figure out what is the reason for the error I get when trying to build it for osx.

What I type:

python3 opencv-master/platforms/osx/build\_framework.py osx --contrib opencv\_contrib-master

And the error I get:

\*\*\*\* BUILD FAILED \*\*\*\*

The following build commands failed:

CompileC /Users/lisagumpoltsberger/Documents/osx/build/build-x86\_64-macosx/modules/world/OpenCV.build/Release/opencv\_world.build/Objects-normal/x86\_64/versions.pb.o /Users/lisagumpoltsberger/Documents/opencv-master/modules/dnn/misc/tensorflow/versions.pb.cc normal x86\_64 c++ com.apple.compilers.llvm.clang.1\_0.compiler

(1 failure)

============================================================

ERROR: Command ‘[‘xcodebuild’, ‘MACOSX\_DEPLOYMENT\_TARGET=10.12’, ‘ARCHS=x86\_64’, ‘-sdk’, ‘macosx’, ‘-configuration’, ‘Release’, ‘-parallelizeTargets’, ‘-jobs’, ‘8’, ‘-target’, ‘ALL\_BUILD’, ‘build’]’ returned non-zero exit status 65.

I would really appreciate it if someone could help me. I tried a few solutions I found online (e.g. changing the deployment target) but nothing worked.

Best regards  
Lisa

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 25, 2021, 5:27pm UTC](https://forum.opencv.org/t/build-opencv-framework-mac-osx-error/2357/2 "2021-03-25T17:27:27Z")

</div>

if you only need OpenCV from python, I’d suggest `pip install opencv-python` (or pip3 or whatever)

---

<div class="post-metadata">

**Author:** ![LisaG](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@LisaG](https://forum.opencv.org/u/LisaG)\
**Post date:** [March 26, 2021, 6:12am UTC](https://forum.opencv.org/t/build-opencv-framework-mac-osx-error/2357/3 "2021-03-26T06:12:38Z")

</div>

I want to use OpenCV with C++. I used the framework installment option because I also want to use my app on devices that don’t have OpenCV installed.

---

<div class="post-metadata">

**Author:** ![Martin](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Martin](https://forum.opencv.org/u/Martin)\
**Post date:** [February 26, 2024, 10:06pm UTC](https://forum.opencv.org/t/build-opencv-framework-mac-osx-error/2357/4 "2024-02-26T22:06:59Z")

</div>

i have the exact same error, i think i know what the problem is  
i tried to compile that file directly:

apparently tensorflow requires C++14 or newer, but the OpenCV xcode project uses the default, i have no idea how to fix this

---

<div class="post-metadata">

**Author:** ![mr.wutianyu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/mr.wutianyu/32/12380_2.png) [@mr.wutianyu](https://forum.opencv.org/u/mr.wutianyu)\
**Post date:** [April 17, 2025, 9:56am UTC](https://forum.opencv.org/t/build-opencv-framework-mac-osx-error/2357/5 "2025-04-17T09:56:00Z")

</div>

I have the same error. Does anyone know how to fix it?
