【发布时间】:2014-01-04 12:06:21
【问题描述】:
我正在尝试在装有 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 时是否也遇到了类似的问题。
感谢您的宝贵时间。 夏基尔
【问题讨论】:
-
同样的问题。看起来系统(环境变量)有问题,但我不知道出了什么问题
标签: ios opencv installation