美文网首页工作生活
OpenCV编译iOS Framework问题解决

OpenCV编译iOS Framework问题解决

作者: pokeey | 来源:发表于2019-07-09 13:51 被阅读0次

编译版本

  • Opencv 3.4.1
  • xCode 10.2.1
  • cMake 3.11

错误一

编译报错:
CalledProcessError: Command '['cmake', '-GXcode', '-DAPPLE_FRAMEWORK=ON', '-DCMAKE_INSTALL_PREFIX=install', '-DCMAKE_BUILD_TYPE=Release', '-DIOS_ARCH=armv7', '-DCMAKE_TOOLCHAIN_FILE=/Users/zhangfan/Documents/opencv-3.4.1/platforms/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake', '-DENABLE_NEON=ON', '/Users/zhangfan/Documents/opencv-3.4.1']' returned non-zero exit status 1

日志错误:
error: An empty identity is not valid when signing a binary for the product type 'Application'

通过将cmake从3.11升级到最新开始出现问题二。

错误二

ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)

解决:
将/platforms/ios/cmake/Toolchains/common-ios-toolchain.cmake中的6.0全部改为8.0,开始出现错误三

错误三

error "C++11 is not supported"

说实话这个我没解决,真的不知道怎么办,最后我把最新的opencv-4.1.0里的opencv-4.1.0/platforms/ios拷贝到了3.4.1替换了对应文件夹里面文件解决了

错误四

3rdparty/libpng/CMakeLists.txt:7
修改3rdparty/libpng/CMakeLists.txt:7,

# if(ENABLE_NEON)
#   project(${PNG_LIBRARY} C ASM)
# else()
#   project(${PNG_LIBRARY} C)
# endif()

project(${PNG_LIBRARY} C)

然后再编译就没在发生问题,如果还有什么问题,请诸位不吝赐教

相关文章

网友评论

    本文标题:OpenCV编译iOS Framework问题解决

    本文链接:https://www.haomeiwen.com/subject/iktrhctx.html