简体   繁体   English

为iOS构建OpenCV失败

[英]Build OpenCV for iOS fail

I downloaded OpenCV folder from GitHub and followed the ReadMe instruction to build it for ios. 我从GitHub下载了OpenCV文件夹,并按照自述文件的说明为ios构建了该文件夹。 After use python opencv/platforms/ios/build_framework.py ios command I have the following error: 使用python opencv/platforms/ios/build_framework.py ios命令后,出现以下错误:

Executing: ['cmake', '-GXcode', '-DAPPLE_FRAMEWORK=ON', '-DCMAKE_INSTALL_PREFIX=install', '-DCMAKE_BUILD_TYPE=Release', '-DIOS_ARCH=armv7', '-DCMAKE_TOOLCHAIN_FILE=/Users/name/Downloads/opencv/platforms/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake', '-DENABLE_NEON=ON', '/Users/name/Downloads/opencv', '-DCMAKE_C_FLAGS=-fembed-bitcode', '-DCMAKE_CXX_FLAGS=-fembed-bitcode'] in /Users/name/Downloads/ios/build/build-armv7-iphoneos
============================================================
ERROR: [Errno 2] No such file or directory
============================================================
Traceback (most recent call last):
  File "opencv/platforms/ios/build_framework.py", line 112, in build
    self._build(outdir)
  File "opencv/platforms/ios/build_framework.py", line 104, in _build
    self.buildOne(t[0], t[1], mainBD, cmake_flags)
  File "opencv/platforms/ios/build_framework.py", line 186, in buildOne
    execute(cmakecmd, cwd = builddir)
  File "opencv/platforms/ios/build_framework.py", line 36, in execute
    retcode = check_call(cmd, cwd = cwd)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

What I have to do to fix it? 我必须做些什么来解决它?

If someone in the future will have the same problem. 如果将来有人会有同样的问题。 This problem was in the master branch, downloading branch 2.4 and adding CMake at PATH the build process go well 这个问题在master分支中,下载分支2.4并在PATH中添加CMake,构建过程顺利进行

I also encountered the same problem. 我也遇到了同样的问题。 In the master branch or 3.4 branch or 2.4 branch. 在master分支或3.4分支或2.4分支中。 But after installing cmake, it will be fine. 但是在安装cmake之后,就可以了。

In the 2.4 branch error message will show : 在2.4分支中,错误消息将显示:

/bin/sh: cmake: command not found

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM