Linking libraries to a QT project using pkg-config output

前端 未结 5 1307
太阳男子
太阳男子 2020-12-09 02:32

This is a bit of a newbie question. I am trying to add the OpenCV libraries to a QT project.

This question says the link flags are given by

pkg-confi         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 03:16

    In the newer version of Qt, this needs to be done to avoid a package not found error:

    QT_CONFIG -= no-pkg-config
    CONFIG += link_pkgconfig
    PKGCONFIG += protobuf #or whatever package here
    

    Also had to do this for Mac:

    mac {
      PKG_CONFIG = /usr/local/bin/pkg-config
    }
    

提交回复
热议问题