Linking libraries OpenCV 2.4.2 on xcode 4.5.1 Linking libraries OpenCV 2.4.2 on xcode 4.5.1 xcode xcode

Linking libraries OpenCV 2.4.2 on xcode 4.5.1


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.