Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. use OpenVC in QT Creator V 11.0.3

use OpenVC in QT Creator V 11.0.3

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 247 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.
  • P Offline
    P Offline
    PaulE
    wrote on 28 Dec 2023, 13:27 last edited by
    #1

    I created a new Project, where i wanted to use Openvc to play a video. I used qmake and QT version 5.15.15. Here is the generated .pro file

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++17
    
    # You can make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    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
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../opencv/build/x64/vc16/lib/ -lopencv_world480
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../opencv/build/x64/vc16/lib/ -lopencv_world480d
    INCLUDEPATH += $$PWD/../../../../opencv/build/include
    DEPENDPATH += $$PWD/../../../../opencv/build/include
    

    I tried to open a video with a simple example

    #include "mainwindow.h"
    #include <QApplication>
    #include "opencv2/opencv.hpp"
    #include "opencv2/videoio.hpp"
    
    using namespace cv;
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        MainWindow w;
        w.show();
        VideoCapture cap(0);
        return a.exec();
    }
    

    When i try to run this example i get a error message

    undefined reference to `cv::VideoCapture::VideoCapture(int, int)`
    undefined reference to `cv::VideoCapture::~VideoCapture()`
    undefined reference to `cv::VideoCapture::~VideoCapture()`
    

    Does someone has a idea how i can fix this error?

    J 1 Reply Last reply 28 Dec 2023, 18:55
    0
    • P PaulE
      28 Dec 2023, 13:27

      I created a new Project, where i wanted to use Openvc to play a video. I used qmake and QT version 5.15.15. Here is the generated .pro file

      QT       += core gui
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      CONFIG += c++17
      
      # You can make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      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
      
      win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../opencv/build/x64/vc16/lib/ -lopencv_world480
      else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../opencv/build/x64/vc16/lib/ -lopencv_world480d
      INCLUDEPATH += $$PWD/../../../../opencv/build/include
      DEPENDPATH += $$PWD/../../../../opencv/build/include
      

      I tried to open a video with a simple example

      #include "mainwindow.h"
      #include <QApplication>
      #include "opencv2/opencv.hpp"
      #include "opencv2/videoio.hpp"
      
      using namespace cv;
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          MainWindow w;
          w.show();
          VideoCapture cap(0);
          return a.exec();
      }
      

      When i try to run this example i get a error message

      undefined reference to `cv::VideoCapture::VideoCapture(int, int)`
      undefined reference to `cv::VideoCapture::~VideoCapture()`
      undefined reference to `cv::VideoCapture::~VideoCapture()`
      

      Does someone has a idea how i can fix this error?

      J Offline
      J Offline
      JonB
      wrote on 28 Dec 2023, 18:55 last edited by JonB
      #2

      @PaulE
      And what compiler/kit are you using? MSVC? Or MinGW...? Because

      -L$$PWD/../../../../opencv/build/x64/vc16/lib/ -lopencv_world480
      

      looks like MSVC library in MinGW link...?

      https://forum.qt.io/topic/152113/opencv-linking-undefined-references

      1 Reply Last reply
      2

      2/2

      28 Dec 2023, 18:55

      • Login

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