Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Error when using pkg-config in qmake file

Error when using pkg-config in qmake file

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
3 Posts 2 Posters 2.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DuinoD Offline
    DuinoD Offline
    Duino
    wrote on last edited by
    #1

    Here is qmake file:

    TEMPLATE = app
    QT += qml quick widgets
    CONFIG += c++11
    
    SOURCES += main.cpp \
        backend.cpp
    
    HEADERS += \
        backend.h
    
    RESOURCES += qml.qrc
    
    INCLUDEPATH +=`pkg-config --cflags opencv`
    LIBS += `pkg-config --libs opencv`
    
    #INCLUDEPATH += /usr/local/opencv_itseesz/include
    #LIBS += /usr/local/opencv_itseesz/lib/*.so
    
    

    When using pkg-config tool to find opencv, error occured:

    /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qapplication.h:37: error: QtCore/qcoreapplication.h: No such file or directory
     #include <QtCore/qcoreapplication.h>
                                         ^
    

    But when not using the pkg-config, like the two commonted lines below, it worked well.

    So, if there is any bugs when using pkg-config in qmake?

    BTW, "pkg-config --cflags --libs opencv" works fine in terminal.

    Thanks.

    Just enjoy coding.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tomma
      wrote on last edited by
      #2

      That is not how you use pkg-config with qmake.
      Check qmake manual: http://doc.qt.io/qt-5/qmake-project-files.html#configuration-features
      You enable pkg-config linking with

      CONFIG += link_pkgconfig
      

      and select packages to use with

      PKGCONFIG += <package1> <package2>...
      
      1 Reply Last reply
      1
      • DuinoD Offline
        DuinoD Offline
        Duino
        wrote on last edited by
        #3

        Much thanks!!!

        Just enjoy coding.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved