我正在尝试在装有 iOS 6.1、Xcode 4.6.3 和 Mac OS X 10.7.5 的机器上编译 opencv 2.4.6.0。我一直在按照opencv 网站上的安装说明安装 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 时也遇到了类似的问题。
谢谢你的时间。沙基尔