Discussion in 'Mac Programming' started by sinser, Oct 1, 2011.

  1. sinser macrumors 6502a


    Sep 16, 2003
    Has someone been able to build OpenCv on Mac Os X Lion ? I have tried using homebrew but I get the following linking error

    Linking CXX shared library ../../lib/libopencv_highgui.dylib
    Undefined symbols for architecture x86_64:
    "_png_set_gray_1_2_4_to_8", referenced from:
    cv::pngDecoder::readData(cv::Mat&) in grfmt_png.o
    ld: symbol(s) not found for architecture x86_64
    collect2: ld returned 1 exit status
    make[2]: *** [lib/libopencv_highgui.2.3.1.dylib] Error 1
    make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
    make: *** [all] Error 2
  2. jiminaus, Oct 1, 2011
    Last edited: Oct 1, 2011

    jiminaus macrumors 65816


    Dec 16, 2010
    You seem to have gotten further than me building opencv 2.2.0 using macports 2.0.3 on Lion 10.7.1 with clang 3.0.

    I failed at:

    [ 59%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_cocoa.o

    With errors in core/core.hpp.

    EDIT: Some research on my case revealed that the issue I'm getting is caused by XCode 4.2 beta. It doesn't appear in XCode 4.1. Also seems opencv 2.3 also doesn't have this problem

    You may be interested in this: How to get OpenCV working under Mac OS X Lion with XCode 4.1
  3. sinser thread starter macrumors 6502a


    Sep 16, 2003
    Yes, I could try macports approach, even if I just was trying to switch to homebrew. I think both packages have problems to coexist.
    Here it looked so simple :-(
  4. sinser thread starter macrumors 6502a


    Sep 16, 2003

Share This Page