C & CXX compiler error detection in opencv ios

I am trying to compile opencv 2.4.6.0 on a machine with iOS 6.1, Xcode 4.6.3 and Mac OS X 10.7.5. I installed the instructions on the opencv website to install opensv ios framework. However, when running the script:

I get some compilation errors.
`python opencv/platforms/ios/build_framework.py ios` 

I tried to narrow down the cause of compilation problems by running cmake commands specified in the python script separately in the terminal window. Therefore, if I run:

 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" ../ 

then the system cannot detect C and CXX compiler information, and most of the tests do not work, as shown below:

 -- 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 

However, if I run the same cmake command without specifying -DCMAKE_TOOLCHAIN_FILE, then I do not get a CXX and C compiler error, as shown below:

 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 

I understand that this error is not due to opencv, but I was wondering if anyone else had a similar problem when installing opencv.

Thank you for your time. Shakir

+4
source share
1 answer

If 2.4.7 is executed, you can get the working structure here: https://github.com/Fl0p/OpenCV-iOS .

You might be able to use an earlier commit for 2.4.6.

0
source

Source: https://habr.com/ru/post/1489898/


All Articles