I have installed opencv with macports following the directions here: Compile OpenCV (2.3.1+) for OS X Lion / Mountain Lion with Xcode
I have also search and tried every
I had the same problem. A build setting default seems to be different in Xcode 4.5.
Under "Build Settings"--> Apple LLVM compiler 4.1 - Language >
C++ Standard Library:= Change from libc++ (LLVM ...) to libstdc++ (GNU C++ ...).
It's very likely that OpenCV has not been compiled with C++11 settings, while the program is. Set the build of your tool without C++11 switches (i.e. -std=c++11 -stdlib=libc++).
Try to manually add the directory where port puts all the dylibs (/opt/local/lib
if I'm not getting wrong) in Build Settings->Library search path. This should fix the linking problem.