Ask Your Question

installation steps opencv-2.4.2 (IOS)

asked 2012-08-06 00:51:27 -0500

Adwa gravatar image Adwa
31 1 1 5

updated 2013-06-07 01:47:32 -0500

Please say to me what steps i should follow for installing 2.4.2 correctly on ios

I downloaded 2.4.2 from here and I have cmake 2.8.8, then i made the following steps (from inside opencv-2.4.2 dirictory):

1- mkdir build

2- cd build

3- sudo cmake -G "Unix Makefiles" ..

4- sudo make -j8

5- sudo make install

RESULTING IN : install path = usr/local , but there were some warnings during building (sudo make -j8)

Then I followed the steps here to link opencv2.4.2 to XCode project

And still the project couldn't see any opencv method

Please any help ?!

delete close flag offensive retag edit

2 Answers

Sort by » oldest newest most voted

answered 2012-08-08 20:42:59 -0500

Tõnu Samuel gravatar image Tõnu Samuel
69 5

updated 2012-08-08 20:44:31 -0500

I do:

mkdir build
cd build
cmake ../OpenCV-2.4.2 -DWITH_QT=YES
make -j4
sudo make install

Mac OSX, Ubuntu Linux all same way and works well.

link delete flag offensive edit


Your way and mine, both generated a lot of warnings after the [84%] of "make -j4", but it built with no errors (just warnings) - Is that ordinary ?!

let me tell you my pain exactly,

There is an error appears in the XCode project after linking the generated libraries and just create a Mat object and Run : ignoring file /../../OpenCV-2.4.2WithDebug/MyBuildDebug/lib/libopencv_highgui.2.4.2.dylib, file was built for unsupported file format which is not the architecture being linked (armv7)

Do you know any idea?! Thanks in advance

Adwa ( 2012-08-09 08:50:34 -0500 )edit

answered 2012-08-26 14:16:20 -0500

Adwa gravatar image Adwa
31 1 1 5

There are 2 ways to install and link opencv-2.4.2 to XCode

  1. following the steps mentioned in the question to install, and following this to link XCode. But honestly this way didn't work with me !! it generated an armv7 architecture error !!!

  2. Just an easy, pure way :

    • Download opencv2.framework from (it's a prebuilt framework -ready to use directly- )
    • Add it to xcode project as adding any library. if you don't know about that, don't worry :) read the content under the title "Adding the OpenCV Framework" here
    • Add headers >> Follow the steps under the title "Include the OpenCV headers" here
    • Write your test code and Run.

Enjoy :)

link delete flag offensive edit


> Download opencv2.framework from


LunarDuck ( 2014-09-02 17:51:27 -0500 )edit

Login/Signup to Answer

Question tools

1 follower

subscribe to rss feed


Asked: 2012-08-06 00:51:27 -0500

Seen: 5,462 times

Last updated: Jun 07 '13