Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. openCV in Qt Creator on Mac
Qt 6.11 is out! See what's new in the release blog

openCV in Qt Creator on Mac

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 553 Views 1 Watching
  • 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.
  • L Offline
    L Offline
    laxmi
    wrote on last edited by aha_1980
    #1

    I tried linking openCV to my Qt project by editing the project file which now reads:

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = image
    TEMPLATE = app
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    CONFIG += c++11
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp
    
    HEADERS += \
            mainwindow.h
    
    FORMS += \
            mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    QT_CONFIG -= no-pkg-config
    CONFIG  += link_pkgconfig
    PKGCONFIG += opencv
    INCLUDEPATH += \
        /usr/local/include
    LIBS += `pkg-config --libs opencv`
    PKG_CONFIG = /usr/local/bin/pkg-config
    
    LIBS += \
        -L/usr/local/lib \
        -lopencv_core \
        -lopencv_highgui
    

    But upon trying to run it I get the error:

    :-1: error: opencv development package not found

    I m using Mac version 10.14.5 , OpenCV version 2.4.13.

    [Edit aha_1980: Added code tags]

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You are mixing several things together. Just use the dedicated variable.

      Next, where is the opencv.pc file located on your system ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

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