How to compile OpenCV for iOS7 (arm64)

前端 未结 8 1363
轻奢々
轻奢々 2020-12-03 16:40

Compiling Xcode Project fails with following errors: \'missing required architecture arm64 in file /Users/*/Git/ocr/opencv2.framework/opencv2\'

It works well, if i c

相关标签:
8条回答
  • 2020-12-03 16:58

    Instead of using terminal commands given in the opencv installation guide in official website, use the following commands. Worked for me.

    cd OpenCV-2.3.1

    mkdir build

    cd build

    cmake -G "Unix Makefiles" ..

    make

    sudo make install

    0 讨论(0)
  • 2020-12-03 17:00

    micahp's answer was almost perfect, but missed the simulator version. So modify platforms/ios/build_framework.py to:

    targets = ["iPhoneOS", "iPhoneOS", "iPhoneOS", "iPhoneSimulator", "iPhoneSimulator"]
    archs = ["armv7", "armv7s", "arm64", "i386", "x86_64"]
    

    You'll need to download the command line tools for Xcode 5.0.1 and then run

    python opencv/platforms/ios/build_framework.py ios
    
    0 讨论(0)
  • 2020-12-03 17:04

    Try to wait a next month. Will release a new XCode with more powerful supporting of 32/64 bit.

    https://developer.apple.com/news/index.php?id=9162013a

    0 讨论(0)
  • 2020-12-03 17:07

    Modify "build_frameworks.py" to:

    def build_framework(srcroot, dstroot):
        "main function to do all the work"
    
        targets = ["iPhoneOS", "iPhoneOS", "iPhoneOS", "iPhoneSimulator"]
        archs = ["armv7", "armv7s", "arm64", "i386"]
        for i in range(len(targets)):
            build_opencv(srcroot, os.path.join(dstroot, "build"), targets[i], archs[i])
    
        put_framework_together(srcroot, dstroot)
    
    0 讨论(0)
  • 2020-12-03 17:09

    I was having a similar error, but the issue wasn't related with the arm64 coompilation.fixed adding the framework libc++.dylib

    0 讨论(0)
  • 2020-12-03 17:14

    The latest OpenCV iOS framework supports 64 bit by default

    It can be downloaded at: OpenCV download page

    0 讨论(0)
提交回复
热议问题