我正在尝试在装有 iOS 6.1、Xcode 4.6.3 和 Mac OS X 10.7.5 的机器上编译 opencv 2.4.6.0。我一直在按照 opencv website 上的安装说明进行操作安装opencv ios框架。但是,我在运行脚本时遇到了一些编译错误:
`python opencv/platforms/ios/build_framework.py ios`
我试图通过在终端窗口中单独运行 python 脚本中给出的 cmake 命令来缩小编译问题的原因。所以如果我运行:
cmake -GXcode -DCMAKE_TOOLCHAIN_FILE=../ios/cmake/Toolchains/Toolchain-iPhoneSimulator_Xcode.cmake -DOPENCV_BUILD_3RDPARTY_LIBS=YES -DCMAKE_XCODE_ATTRIBUTE_GCC_VERSION="com.apple.compilers.llvmgcc42" ../
然后系统无法检测到 C 和 CXX 编译器信息,大多数测试都失败了,如下所示:
-- Setting up iPhoneSimulator toolchain
-- iPhoneSimulator toolchain loaded
-- Setting up iPhoneSimulator toolchain
-- iPhoneSimulator toolchain loaded
-- The CXX compiler identification is Clang 4.2.0
-- The C compiler identification is Clang 4.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Performing Test HAVE_CXX_FSIGNED_CHAR
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Failed
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Failed
但是,如果我在不指定 -DCMAKE_TOOLCHAIN_FILE 的情况下运行相同的 cmake 命令,那么我不会收到如下所示的 CXX 和 C 编译器错误:
cmake -GXcode -DOPENCV_BUILD_3RDPARTY_LIBS=YES -DCMAKE_XCODE_ATTRIBUTE_GCC_VERSION="com.apple.compilers.llvmgcc42" ../
-- The CXX compiler identification is Clang 4.2.0
-- The C compiler identification is Clang 4.2.0
-- Check for working CXX compiler using: Xcode
-- Check for working CXX compiler using: Xcode -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working C compiler using: Xcode
-- Check for working C compiler using: Xcode -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Performing Test HAVE_CXX_FSIGNED_CHAR
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Success
-- Performing Test HAVE_C_FSIGNED_CHAR
我知道这个错误不是由 opencv 引起的,但我想知道是否其他人在安装 opencv 时也遇到了类似的问题。
感谢您的宝贵时间。 沙基尔
最佳答案
如果 2.4.7 可以,您可以在这里获得一个工作框架:https://github.com/Fl0p/OpenCV-iOS .
您可以使用 2.4.6 的早期提交。
关于ios - 在 opencv ios 中检测 C & CXX 编译器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17488991/