Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The missing symbol error you receive is indicative of a mismatch between the c++ library that OpenCV was built with, and the one you are using for your application. More specifically, it looks like OpenCV was compiled with libstdc++ whereas your app seems to be using libc++, indicated by the missing OpenCV symbols involving the std::__1 namespace. Libc++ and libstdc++ have incompatible implementations of some c++ standard types, and so libc++ uses the inline namespace std::__1 to avoid accidentally mixing code compiled with libstdc++ (and whose interfaces use c++ standard types) with incompatible c++ type implementations from libc++.

I suggest recompiling your code with libstdc++ (CMAKE_CXXFLAGS="-stdlib=libstdc++", but this may not even be necessary), which is the default for Mountian Lion. Also I am unsure as to the c++11 compliance of OpenCV at the moment, so I would leave those flags out. The CMAKE_SHARED_LINKER_FLAGS is unnecessary when you are setting "-stdlib=" in CMAKE_CXXFLAGS. If this does not help, then you should post the error message when linking with libstdc++.