Linking OpenCV to Qt Creator

后端 未结 2 1684
我在风中等你
我在风中等你 2021-01-27 02:26

I\'m trying to use opencv 4 in QT creator, I\'m working on Mac but I can\'t be able to link the library, I always have a error like on picture 2.

ple

2条回答
  •  無奈伤痛
    2021-01-27 02:52

    First of all be sure you installed OpenCV correctly and working fine. You can check OpenCV exist or not by:

    pkg-config --modversion opencv

    It depends how you installed OpenCV but linking OpenCV libraries and flags to Qt is simply like adding these two line to your .pro file:

    INCLUDEPATH += /usr/local/include/opencv # depends on how you installed
    LIBS += `pkg-config --cflags --libs opencv`
    

    This tutorial is also very helpful.

提交回复
热议问题