Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Problem with OpenCV dlls after deploying to another computer



  • 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


  • Lifetime Qt Champion

    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.



  • 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"



  • 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


  • Lifetime Qt Champion

    Did you use Dependency Walker on the OpenCV dlls ?


Log in to reply