2013-07-05 61 views
4

我想在iOS 6.1,Xcode 4.6.3和Mac OS X 10.7.5的机器上编译opencv 2.4.6.0。我一直在按照opencv website上的安装说明来安装opencv ios框架。在opencv ios中检测C&CXX编译器错误

`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 

但是,如果我运行相同cmake的命令,而不指定-DCMAKE_TOOLCHAIN_FILE然后我不明白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时出现类似的问题。

谢谢你的时间。 Shakir

+0

同样的问题。看起来像系统有问题(env vars),但我无法弄清楚什么是错的 – Flop

回答