Ask Your Question

How install OpenCV in osx 10.9 Maverick

asked 2013-11-23 22:32:31 -0500

danteqw gravatar image

I doing this

tar xvzf opencv- * Navigate to extracted folder `cd path/to/folder` * Create a build directory and build opencv with the following commands mkdir build cd build cmake -G "Unix Makefiles"... * Make and install make -j8 sudo make install ```

Set up an OpenCV project in XCode

  • Start XCode
  • Create new "Command Line Tool" project with type C++ screenshot

  • Add OpenCV to your project

  • Right click your project on the sidebar, select "Add files to..." screenshot
  • When the file chooser dialog opens up, press cmd + shift + G and enter "/usr/local/lib" screenshot
  • Select the required OpenCV files (named in the format libopencv_*.dylib), or select all. Press Add or Return screenshot
  • You will see that all selected files are now in the sidebar. You can youp them together by creating a new _Group_ and dragging the files in there. screenshot
  • Configure your project
  • Click on the project (in the side bar), and you should see the Project settings come up in the middle of the editor
  • Click the All view (top left corner)
  • In the search bar type "Header Search Paths", double click the value, remove the existing entries and add /usr/local/lib and /usr/local/include screenshot
  • Now search for "Library Search Paths" and replace the values with /usr/local/lib
  • Search for "C++ Standard Library" and select "libstdc++ (GNU C++ Standard Library)" screenshot
  • Try the configuration
  • Run one of the sample OpenCV projects

When I try compiling always showing an error

clang: error: linker command failed with exit code 1 (use -v to see invocation)

edit retag flag offensive close merge delete


What exactly is the error? Post a gist or similar of the complete error log.

jensenb gravatar imagejensenb ( 2013-12-03 14:30:17 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-12-03 14:41:53 -0500

jensenb gravatar image

I recommend using homebrew to install OpenCV and its dependencies if you are not too familiar with building them manually. OpenCV 2.4.7 is able to build without Cuda just fine on Mavericks currently. Most likely you experienced problems due to some of OpenCV's dependencies being built against libstdc++, while OpenCV and your being built against libc++ (the new default on Mavericks). This is solved by rebuilding OpenCV and all of its dependencies after upgrading.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2013-11-23 22:32:31 -0500

Seen: 4,730 times

Last updated: Dec 03 '13