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. Problem with OpenCV dlls after deploying to another computer
QtWS25 Last Chance

Problem with OpenCV dlls after deploying to another computer

Scheduled Pinned Locked Moved Solved 3rd Party Software
5 Posts 2 Posters 1.4k 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.
  • S Offline
    S Offline
    scytherlein
    wrote on last edited by
    #1

    Hi,

    I developed a little application to process video files with Qt using OpenCV.
    Everything is working well on my own computer even if I deployed the application.

    If I try to start the application on another Computer the application is starting and running until OpenCV components are used.

    I found out that OpenCV libraries are missing "for the application" altough windows recognices them and they are located in the deployment folder.

    Is there any way to include those files kind of relative in the .pro file ?

    This is my .pro File with the libraries I need out of OpenCV

    #-------------------------------------------------
    #
    # Project created by QtCreator 2018-06-06T08:28:26
    #
    #-------------------------------------------------
    
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = Image_Response_Time
    TEMPLATE = app
    
    INCLUDEPATH += C:\opencv\release\include
    
    # Opencv libs (release folder)
    
    LIBS += C:\opencv\release\bin\libopencv_core342.dll
    LIBS += C:\opencv\release\bin\libopencv_imgcodecs342.dll
    LIBS += C:\opencv\release\bin\libopencv_imgproc342.dll
    LIBS += C:\opencv\release\bin\libopencv_videoio342.dll
    
    
    
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which has been marked as deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    
    SOURCES += \
            main.cpp \
        player.cpp \
        mainwindow.cpp \
        stringwindow.cpp \
        fileio.cpp
    
    HEADERS += \
            mainwindow.h \
        player.h \
        player.h \
        stringwindow.h \
        fileio.h
    
    FORMS += \
            mainwindow.ui \
        stringwindow.ui
    
    RESOURCES +=
    
    

    Thank you

    SGaistS 1 Reply Last reply
    0
    • S scytherlein

      Hi,

      I developed a little application to process video files with Qt using OpenCV.
      Everything is working well on my own computer even if I deployed the application.

      If I try to start the application on another Computer the application is starting and running until OpenCV components are used.

      I found out that OpenCV libraries are missing "for the application" altough windows recognices them and they are located in the deployment folder.

      Is there any way to include those files kind of relative in the .pro file ?

      This is my .pro File with the libraries I need out of OpenCV

      #-------------------------------------------------
      #
      # Project created by QtCreator 2018-06-06T08:28:26
      #
      #-------------------------------------------------
      
      QT       += core gui
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      TARGET = Image_Response_Time
      TEMPLATE = app
      
      INCLUDEPATH += C:\opencv\release\include
      
      # Opencv libs (release folder)
      
      LIBS += C:\opencv\release\bin\libopencv_core342.dll
      LIBS += C:\opencv\release\bin\libopencv_imgcodecs342.dll
      LIBS += C:\opencv\release\bin\libopencv_imgproc342.dll
      LIBS += C:\opencv\release\bin\libopencv_videoio342.dll
      
      
      
      
      # The following define makes your compiler emit warnings if you use
      # any feature of Qt which has been marked as deprecated (the exact warnings
      # depend on your compiler). Please consult the documentation of the
      # deprecated API in order to know how to port your code away from it.
      DEFINES += QT_DEPRECATED_WARNINGS
      
      # You can also make your code fail to compile if you use deprecated APIs.
      # In order to do so, uncomment the following line.
      # You can also select to disable deprecated APIs only up to a certain version of Qt.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      
      SOURCES += \
              main.cpp \
          player.cpp \
          mainwindow.cpp \
          stringwindow.cpp \
          fileio.cpp
      
      HEADERS += \
              mainwindow.h \
          player.h \
          player.h \
          stringwindow.h \
          fileio.h
      
      FORMS += \
              mainwindow.ui \
          stringwindow.ui
      
      RESOURCES +=
      
      

      Thank you

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you check that you have all dependencies installed along your application including OpenCV ? You can use Dependency Walker for that.

      On an unrelated note:
      @scytherlein said in Problem with OpenCV dlls after deploying to another computer:

      LIBS += C:\opencv\release\bin\libopencv_core342.dll
      LIBS += C:\opencv\release\bin\libopencv_imgcodecs342.dll
      LIBS += C:\opencv\release\bin\libopencv_imgproc342.dll
      LIBS += C:\opencv\release\bin\libopencv_videoio342.dll

      This is wrong, you don't link against .dll files but the corresponding .lib files.

      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
      0
      • S Offline
        S Offline
        scytherlein
        wrote on last edited by scytherlein
        #3

        Thank you for your quick response

        I've already checked for dependencies with Dependency Walker, everything is fine concerning on them.

        In my built OpenCV Package there are only those .dll files but not the .lib files.

        Im only able to find those files with the ending ".dll.a"

        1 Reply Last reply
        0
        • S Offline
          S Offline
          scytherlein
          wrote on last edited by
          #4

          I've solved the Problem !

          Although Dependency Checker marked only 3 OpenCV .dll's the programm is using more of them.
          They are connected internally, so it is impossible to find out which one you should use.

          I simply figured out the right one by try and error.

          Thank you

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

            Did you use Dependency Walker on the OpenCV dlls ?

            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
            0

            • Login

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