編譯ios框架時,我遵循opencv安裝文檔Installation in iOS。但是,如果我沒有改變platform/ios/build_framework.py
,並建立框架,我有以下錯誤:無法爲架構arm64和x86_64構建opencv ios框架
build settings from command line:
ARCHS = x86_64
IPHONEOS_DEPLOYMENT_TARGET = 6.0
SDKROOT = iphonesimulator6.1
Build Preparation
Build task concurrency set to 8 via user default IDEBuildOperationMaxNumberOfConcurrentCompileTasks
=== BUILD AGGREGATE TARGET ZERO_CHECK OF PROJECT OpenCV WITH CONFIGURATION Release ===
Check dependencies
=== BUILD NATIVE TARGET zlib OF PROJECT OpenCV WITH CONFIGURATION Release ===
=== BUILD NATIVE TARGET libjpeg OF PROJECT OpenCV WITH CONFIGURATION Release ===
** BUILD FAILED **
Build settings from command line:
ARCHS = x86_64
IPHONEOS_DEPLOYMENT_TARGET = 6.0
SDKROOT = iphonesimulator6.1
=== BUILD NATIVE TARGET zlib OF PROJECT OpenCV WITH CONFIGURATION Release ===
Check dependencies
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
** BUILD FAILED **
然後,多次嘗試之後,我發現,如果我只編譯通過改變建築的ARMv7,armv7s和i386在platform/ios/build_framework.py
的腳本中,可以成功構建框架。
targets = ["iPhoneOS", "iPhoneOS", "iPhoneSimulator"] #"iPhoneOS", "iPhoneSimulator"
archs = ["armv7", "armv7s", "i386"]#"arm64", , "x86_64"
for i in range(len(targets)):
build_opencv(srcroot, os.path.join(dstroot, "build"), targets[i], archs[i])
關於如何編譯arm64和x86_64架構的任何想法?謝謝。
感謝您的意見。我現在正在爲xcode編譯ios(ipad和iphone)。事實上,我的Mac是64位桌面,所以我的機器可以在64位上運行。 – feelfree
iPhone 5s也是64位的 – JoeyJAL