Ask Your Question

Revision history [back]

Hello Macs,

When you run into this problem of 'undefined symbols' with MacOS and opencv, I think it is because the calling conventions are different for clang++ C99 and c++11 (it shows you are calling g++ but on Mavericks that is symlinked to clang IIRC...unless you are actually using g++ installed with brew or some such...but then this error probably wouldn't happen). What you need to do is add:

QMAKE_CXXFLAGS+=-std=c++11 QMAKE_CXXFLAGS+=-stdlib=libc++

QMAKE_LFLAGS+=-std=c++11 QMAKE_LFLAGS+=-stdlib=libc++

to your .pro file. You will also need to add:

QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7

because libc++ is only supported on 10.7+. And that should fix things... YMMV ;)

Thanks, K.Wilson

P.S. Please post back if this fixes things, as it may help others.