1

I tried to follow these instructions get OpenCV to compile on my MAC MINI, but failed at step 6:

../opencv_cmake.sh Simulator ../OpenCV-2.1.0

I got these errors, and I can't make sense of it. Any clues?

Starting cmake...
Target SDK            = iPhoneSimulator
iOS SDK Version       = 4.1
iOS Deployment Target = 3.0
OpenCV Root           = ../OpenCV-2.1.0
OpenCV Install Prefix = /Users/haoest/Development/iphone_opencv_test/build_simulator/../opencv_simulator

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc
-- Check for working C compiler: /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -- broken
CMake Error at /Applications/CMake 2.8-4.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler
  "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" is
  not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /Users/haoest/Development/iphone_opencv_test/build_simulator/CMakeFiles/CMakeTmp



  Run Build Command:/usr/bin/make "cmTryCompileExec/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  "/Applications/CMake 2.8-4.app/Contents/bin/cmake" -E cmake_progress_report
  /Users/haoest/Development/iphone_opencv_test/build_simulator/CMakeFiles/CMakeTmp/CMakeFiles
  1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o

  /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc
  -isysroot
  /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk
  -mmacosx-version-min="10.6" -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c
  /Users/haoest/Development/iphone_opencv_test/build_simulator/CMakeFiles/CMakeTmp/testCCompiler.c


  Linking C executable cmTryCompileExec

  "/Applications/CMake 2.8-4.app/Contents/bin/cmake" -E cmake_link_script
  CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1

  /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc
  -isysroot
  /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk
  -mmacosx-version-min="10.6" -Wl,-search_paths_first
  -Wl,-headerpad_max_install_names
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o cmTryCompileExec

  ld: warning: in
  /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/usr/lib/libSystem.dylib,
  file was built for i386 which is not the architecture being linked (x86_64)

  Undefined symbols:

    "_exit", referenced from:
        start in crt1.10.6.o

  ld: symbol(s) not found

  collect2: ld returned 1 exit status

  make[1]: *** [cmTryCompileExec] Error 1

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:39 (project)

-- Configuring incomplete, errors occurred!

karlphillip
  • 92,053
  • 36
  • 243
  • 426
Haoest
  • 13,610
  • 29
  • 89
  • 105

3 Answers3

3

Try this one: http://computer-vision-talks.com/2010/12/building-opencv-for-ios/

BloodAxe
  • 833
  • 9
  • 10
1

You do realise that there's a pre-compiled version for you by Niwa (either via that github link or on his site http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en) where you can just open the Xcode opencv_test.proj file. It includes an example project to get you started, which you can build on from there. It works for both the iPhone device and the simulator.

LeonardChallis
  • 7,759
  • 6
  • 45
  • 76
0

OpenCV is now available as a framework for iOS. Just drag and drop into your project. It supports video capture too. See the article and get the example project here.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Robin Summerhill
  • 13,695
  • 3
  • 41
  • 37