title: opencv framework for iOS error
body: <p>I am trying to build the opencv framework for Xcode. I am new to the Mac world as well as opencv. I followed the instructions as given on </p>
  
  <p><a href="http://docs.opencv.org/doc/tutorials/introduction/ios_install/ios_install.html" rel="nofollow">http://docs.opencv.org/doc/tutorials/introduction/ios_install/ios_install.html</a> </p>
  
  <p>I cloned the repository (opencv 2.4.7) and then tried running the python script - as per the instruction on the link</p>
  
  <p>python opencv/platforms/ios/build_framework.py ios</p>
  
  <p>I get the below error, can someone please help? I am using OSX 10.8.5</p>
  
  <blockquote>
  <pre><code>Applications/gebos_third_party_apps/opencv/3rdparty/zlib/gzwrite.c:84:15:
  </code></pre>
    
    <p>note: did you mean 'fwrite'? got = write(state->fd, strm->next_in,
    strm->avail_in); ^~~~~ fwrite In file included from
    /Applications/gebos_third_party_apps/opencv/3rdparty/zlib/gzwrite.c:6:
    In file included from
    /Applications/gebos_third_party_apps/opencv/3rdparty/zlib/gzguts.h:21:</p>
  
  <pre><code>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/stdio.h:252:9:
  </code></pre>
    
    <p>note: 'fwrite' declared here size_t fwrite(const void * __restrict,
    size_t, size_t, FILE * __restrict) __DARWIN_ALIAS(fwrite); ^
    /Applications/gebos_third_party_apps/opencv/3rdparty/zlib/gzwrite.c:573:9:
    error: implicit declaration of function 'close' is invalid in C99
    [-Werror,-Wimplicit-function-declaration] if (close(state->fd) == -1)
    ^ 2 errors generated.</p>
  
  <pre><code>** INSTALL FAILED **
  
  The following build commands failed: CompileC /Applications/gebos_third_party_apps/ios/build/iPhoneSimulator-x86_64/3rdparty/zlib/OpenCV.build/Release-iphonesimulator/zlib.build/Objects-normal/x86_64/gzwrite.o
  </code></pre>
    
    <p>3rdparty/zlib/gzwrite.c normal x86_64 c
    com.apple.compilers.llvm.clang.1_0.compiler CompileC
    /Applications/gebos_third_party_apps/ios/build/iPhoneSimulator-x86_64/3rdparty/zlib/OpenCV.build/Release-iphonesimulator/zlib.build/Objects-normal/x86_64/gzlib.o
    3rdparty/zlib/gzlib.c normal x86_64 c
    com.apple.compilers.llvm.clang.1_0.compiler CompileC
    /Applications/gebos_third_party_apps/ios/build/iPhoneSimulator-x86_64/3rdparty/zlib/OpenCV.build/Release-iphonesimulator/zlib.build/Objects-normal/x86_64/gzread.o
    3rdparty/zlib/gzread.c normal x86_64 c
    com.apple.compilers.llvm.clang.1_0.compiler (3 failures) Traceback
    (most recent call last): File
    "opencv-lib/opencv/platforms/ios/build_framework.py", line 112, in
    
    build_framework(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]),
    "../..")), os.path.abspath(sys.argv[1])) File
    "opencv-lib/opencv/platforms/ios/build_framework.py", line 104, in
    build_framework put_framework_together(srcroot, dstroot) File
    "opencv-lib/opencv/platforms/ios/build_framework.py", line 80, in
    put_framework_together shutil.copytree(tdir0 +
    "/install/include/opencv2", dstdir + "/Headers") File
    "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
    line 168, in copytree names = os.listdir(src) OSError: [Errno 2] No
    such file or directory:
    '../build/iPhoneOS-arm64/install/include/opencv2'</p>
  </blockquote>