Search code examples
opencvosx-snow-leopard

Error installing openCV 2.3.0 / 2.3.1 on mac os X 10.6.8


I am trying since two days to install OpenCV 2.3.0 or 2.3.1 on my mac 10.6.8 snow leopard. I followed the following commands

$ cd /Users/ateendra/Desktop/OpenCV-2.3.0/  
$ mkdir build  
$ cd build/  
$ cmake -D CMAKE_OSX_ARCHITECTURES=i386 -D CMAKE_C/CXX_FLAGS=-m32 ..  
$ ccmake .  
$ make -j8  
$ sudo make install  

now i get the following errors

 /Users/ateendra/Desktop/OpenCV-2.3.0/modules/highgui/src/grfmt_exr.hpp:83: error: reference to ‘PixelType’ is ambiguous  
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers         /QuickdrawTypes.h:193: error: candidates are: typedef SInt8 PixelType  
/opt/local/include/OpenEXR/ImfPixelType.h:49: error: enum Imf::PixelType  
/Users/ateendra/Desktop/OpenCV-2.3.0/modules/highgui/src/grfmt_exr.hpp:83: error: ‘PixelType’ does not name a type  
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/loadsave.o] Error 1  
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2  

Solution

  • I've managed to install OpenCV 2.3.1 on OSX 10.6.8, but I've done it using MacPorts, (which I recommend as it deals with dependencies and building for you):

    1. Make sure you've got Apple Developer Tools installed (or at least XCode with the command line tools)
    2. Install MacPorts (if you haven't done so already)
    3. Install OpenCV via MacPorts:

      sudo port install opencv

    For more details see Build via MacPorts on the wiki.

    I also have to mention that I did run into an error, but that was because of a previous existing dylib in the wrong place.