编译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