0

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  
user1036908
  • 831
  • 1
  • 12
  • 16

2 Answers2

1

Well, this is a common problem to compile opencv under mac os, though it is usually solvable by modifying opencv sources a bit. (I faced this problem twice, and I always changed sources a bit to make everything compile).

However, the last time I was installing opencv, I've just used brew:

brew install opencv

Didn't have any problems with it.

Ixanezis
  • 1,631
  • 13
  • 20
0

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.

George Profenza
  • 50,687
  • 19
  • 144
  • 218
  • hi, i to am running into erros, but unlike yours, there is no libjpeg.dylib that needs to be deleted. i cannot understand the log. will you be able to debug the log file? – user1036908 Apr 13 '12 at 19:37
  • hi, if you're running into errors from MacPorts I would recommend doing what I did: [open a ticket](http://trac.macports.org/newticket) with them. You can add a log I could have a look at but as I'm a beginner I can't guarantee I'll be able to figure it out I'm afraid. – George Profenza Apr 13 '12 at 22:10