Take the 2-minute tour ×

I am not a Unix guy, so I have been trying to install openCV 2.0 for days with out success. I just downloaded the opencv library form sourceforge from this page: http://sourceforge.net/projects/opencvlibrary/ Does any one know the exact unix terminal commands for installing it?

please don't say "go to google", I already did. I found this: http://opencv.willowgarage.com/wiki/InstallGuide and this http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port but the explanations are not very good for unix beginners.

installations always fails in the end.

It would be great if I can make a framework. for example OpenCV.framework from the current source, So I can use it with Xcode, and Cocoa easier.


I did:

downloaded it. extracted it.

cd Downloads/OpenCV-2.0.0

and got this when linking all the .o files.

mv -f .deps/saving.Tpo .deps/saving.Plo
mv -f .deps/logger.Tpo .deps/logger.Plo
mv -f .deps/index_testing.Tpo .deps/index_testing.Plo
libtool: link: (cd .libs/lib_clapack.lax/lib_clapack_floatstore.a && ar x "/Users/nacho4d/Downloads/OpenCV-2.0.0 3/build_i386/3rdparty/./.libs/lib_clapack_floatstore.a")
../libtool: line 961: cd: .libs/lib_clapack.lax/lib_clapack_floatstore.a: No such file or directory
make[2]: *** [lib_clapack.la] Error 1
mv -f .deps/flann.Tpo .deps/flann.Plo
make: *** [all] Error 2
Creating universal Framework
cp: build_ppc/OpenCV.framework: No such file or directory
lipo: can't open input file: build_ppc/OpenCV.framework/OpenCV (No such file or directory)


Do I need to do something before running the shell script?

EDIT: For the interested, I wrote a post on how to install and use OpenCV 2.1.1 on Macs here: http://nacho4d-nacho4d.blogspot.com/2010/07/blog-post.html

share|improve this question
How exactly does it fail? –  ShiDoiSi Oct 3 '09 at 4:12
I updated the question with the error i have when running the shell script. –  nacho4d Oct 4 '09 at 3:13
I have a small post how to install OpenCV 2.1.1 in Macs. nacho4d-nacho4d.blogspot.com/2010/07/blog-post.html –  nacho4d Aug 24 '10 at 2:07
add comment

3 Answers

I had a problem compiling on Snow Leopard too, but was able to get it to work by following the instructions at: http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port

The only modification I had to make was also to disable ffmpeg inside of ccmake

The GNU autotools methods (make && make install) are being outdated. Volunteers to edit this section?

mkdir opencv/build cd opencv/build cmake .. ccmake .

If you are on Snow Leopard, hit 't' to toggle advanced mode. Set CMAKE_CXX_COMPILER="/usr/bin/g++-4.0" and CMAKE_C_COMPILER="/usr/bin/gcc-4.0" and then continue with the following steps.

Hit 'c' to configure. Hit 'g' to generate the config file and exit ccmake.

make -j8 sudo make install

If you hit the following build error:

/Users/awagner/Developer/opencv2/src/highgui/grfmt_tiff.cpp:292: error: ‘fmtSignTiffII’ was not declared in this scope make[2]: * [src/highgui/CMakeFiles/highgui.dir/grfmt_tiff.o] Error 1 make1: * [src/highgui/CMakeFiles/highgui.dir/all] Error 2

you can get the build to complete by commenting out line 292 of src/highgui/grfmt_tiff.cpp and running make again. (This probably breaks something in TIFF export, but the build at least completes)

share|improve this answer
add comment
up vote 0 down vote accepted

Ok, I just solved it. In fact there is a bug somewhere, because if your path contains a space shell scripts will fail.

for example.

/Users/nacho4d/Downloads/OpenCV-2.0.0 3

this will fail because current folder "OpenCV-2.0.0 3" has a space.

It took me many hours to realize this. ;(


share|improve this answer
For the interested: I have a small post how to install OpenCV 2.1.1 in Macs. nacho4d-nacho4d.blogspot.com/2010/07/blog-post.html 2.1 uses Cocoa. Hence works better on macs. –  nacho4d Aug 24 '10 at 2:09
add comment

TL;DR of the link nacho4d posted:

brew install opencv

and after about 30mins of crunching, you should have OpenCV installed.


However, if you get an error from brew when its trying to install opencv then read this: https://github.com/mxcl/homebrew/pull/6424#issuecomment-2333585 and edit the brew recipe with:

export EDITOR nano # optional, but for novices nano is easier than vim
brew edit opencv

then run brew install opencv again.

share|improve this answer
add comment

Your Answer


