Ask Your Question

build error opencv 2.4.5 OS X 10.8

asked 2013-05-29 23:07:32 -0500

Trying to build opencv 2.4.5 on OS X 10.8, but the 'make' step runs into a compile error. Thanks in advance for any help! I was following these steps:

tar xvf ~/Downloads/opencv-2.4.5.tar.gz cd opencv-2.4.5 mkdir build cd build cmake -G "Unix Makefiles" .. make

Everything seems to work fine, until this:

Scanning dependencies of target opencv_highgui [ 31%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap.cpp.o ... [ 32%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/ In file included from /Applications/opencv-2.4.5/modules/highgui/src/ /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:34: error: Foundation/Foundation.h: No such file or directory /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:26: error: AppKit/AppKit.h: No such file or directory

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-06-13 18:59:53 -0500

Ken Ma gravatar image

What compiler were you using? I got similar problem when I tried to compile opencv with GNU gcc installed by myself. When I configured my cmake to use clang instead of gcc, everything works. I guess the gui part might not be compatible with GNU gcc?

edit flag offensive delete link more


thanks for your advice~ I use cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_CXX_COMPILER=/usr/bin/clang++ .. and everything goes ok :)

phonicavi gravatar imagephonicavi ( 2016-09-27 11:40:01 -0500 )edit

Question Tools


Asked: 2013-05-29 23:07:32 -0500

Seen: 502 times

Last updated: Jun 13 '13