Attention! This forum will be made read-only by Dec-20. Please migrate to Most of existing active users should've received invitation by e-mail.
Ask Your Question

Unable to build opencv for iOS using terminal in MacOS System

asked 2015-12-24 05:37:53 -0500

updated 2015-12-25 02:43:54 -0500

mshabunin gravatar image

Until downloading using git is fine, but when I tried to build the opencv I am getting the below error.

$user: OpenC cmc1$ python opencv/platforms/ios/ ios
Executing: ['cmake', '-GXcode', '-DAPPLE_FRAMEWORK=ON', '-DCMAKE_INSTALL_PREFIX=install', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_TOOLCHAIN_FILE=/Users/Desktop/OpenC/opencv/platforms/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake', '-DENABLE_NEON=ON', '/Users/Desktop/OpenC/opencv', '-DCMAKE_C_FLAGS=-fembed-bitcode', '-DCMAKE_CXX_FLAGS=-fembed-bitcode'] in /Users/Desktop/OpenC/ios/build/armv7-iPhoneOS
ERROR: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "opencv/platforms/ios/", line 87, in build
  File "opencv/platforms/ios/", line 81, in _build
    self.buildOne(t[0], t[1], mainBD, cmake_flags)
  File "opencv/platforms/ios/", line 133, in buildOne
    execute(cmakecmd, cwd = builddir)
  File "opencv/platforms/ios/", line 34, in execute
    retcode = check_call(cmd, cwd = cwd)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
edit retag flag offensive close merge delete


You have to use version 2.4.7. I have 2 apps in the App store that use opencv. They both were disabled by iOS9. You dont have to build anything for iOS. Download version 2.4.7, drag and drop into project. Make sure Copy Files box is checked. You also have to disable bitcode for it to work, since there is no bitcode in opencv. Even the new fix they claim works does not, I built it and nothing was in the iOS folder.

jmbapps gravatar imagejmbapps ( 2015-12-24 10:04:44 -0500 )edit

@sivakrishna209 , do you have cmake installed?

@jmbapps , can you please describe the problems with the bitcode in details? Did you try to use the official iOS release: ?

mshabunin gravatar imagemshabunin ( 2015-12-25 02:49:09 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2016-01-27 13:39:31 -0500

jmbapps gravatar image

updated 2016-01-27 13:40:13 -0500

I have completed a test project in Xcode using opencv 3.1. El Capitan 10.11.3, Xcode 7.2. No Swift yet, but I believe it will work. Works fine with Obj C. You do not need to build anything for iOS. Just download the framework and add it your frameworks in Xcode. I did 'not' disable bitcode with this project.

edit flag offensive delete link more


I have tried using pre-built framework 2.4.13 for IOS and when added to my project , the project did not link. I guess I have not installed framework properly. What I did I have downloaded the 2.4.13 famework for IOS as a zip file. Extracted in my Downlods folder and then dragged to my Xcode projects. Where exactly should I put the extracted framework?

marp gravatar imagemarp ( 2016-06-02 23:40:48 -0500 )edit

In Xcode. General tab for Target. Scroll to + under Linked frameworks and Libraries. Do not add to binaries, this will cause an issue. Xcode automatically adds frameworks to binaries sometimes, delete is from binaries if Xcode adds it. Older versions seemed to work better if you click and drag project into Xcode, then make sure you click the 'copy files' checkbox. Why are you using such an old framework?

jmbapps gravatar imagejmbapps ( 2016-06-04 08:10:24 -0500 )edit

It worked, Thank you. Using 2.4.13 because I want to port a linux project which has been built with this version. I am told by by author that the project doesn't work with 3.1. I think that once I get into coding I will switch to new version. I an new with ocv and don't know 3.1 is backward compatible with code written for 2.4.

marp gravatar imagemarp ( 2016-06-04 11:19:01 -0500 )edit

Anytime homie! Good luck with your project! :o)

jmbapps gravatar imagejmbapps ( 2016-06-04 13:21:12 -0500 )edit

answered 2015-12-24 11:36:15 -0500

I have the same error. I'm new to using OpenCV, what it means disable bit code?

edit flag offensive delete link more


Under the 'Build Settings' tab. Find 'Build Options'. Enable Bitcode set to Yes or No.

jmbapps gravatar imagejmbapps ( 2015-12-25 10:01:57 -0500 )edit
Login/Signup to Answer

Question Tools



Asked: 2015-12-24 05:37:53 -0500

Seen: 1,076 times

Last updated: Jan 27 '16