Setting up OpenCV in QT on OSX

后端 未结 3 763
清歌不尽
清歌不尽 2020-12-28 23:23

I am trying to set up OpenCV to work with QT on OSX 10.7.5/MacbookPro 2.5 Ghz Intel Core 2 Duo. I\'ve seen a few related question here (How to link

3条回答
  •  灰色年华
    2020-12-28 23:55

    I just stumbled over the same problem. Here is how I solved it:

    As sansuiso already suggested, the problem appears to be the C++-STD-lib you are trying to link against. You are probably trying to link libc++ (LLVM ...) but instead libstdc++ (GNU C++ ...) should be used.

    Using the Qt Creator you can add the following to your .pro-file:

    mac: CONFIG += MAC_CONFIG
    
    MAC_CONFIG {
        QMAKE_CXXFLAGS = -std=c++11 -stdlib=libstdc++ -mmacosx-version-min=10.7
        QMAKE_LFLAGS = -std=c++11 -stdlib=libstdc++ -mmacosx-version-min=10.7
    }
    

    This answer could also be interesting for your problem: https://stackoverflow.com/a/12852913/1141118

    Hope this helps!

提交回复
热议问题