0

i have a problem with my qt deployment under windows 10. For the beginning, i'm using QtCreator 4.5.0 and Qt 5.10 on Windows 10. For the deployment i configerd my project file like the awnser in this question ( Automatic Copy of Dependent Files in Qt Creator ) For more than one year it works fine but since the end of last year it does'nt. If i build the release version all is fine but in debug mode some dll's missing. If i copy this ones manually the program run correct otherwise no icons will be displayed. So far i can see it in git there are no modifications in the project file since it works correct at last.


The deployment line from project file:



    #######################################
    # Deploy Settings

    TARGET_CUSTOM_EXT = .exe
    DEPLOY_COMMAND = windeployqt

    ProgramData.path = C:/ProgramData/Application
    ProgramData.files += ressource/xml/config.xml
    ProgramData.files += ressource/xml/user.xml
    ProgramData.files += ressource/xml/documentation.xml
    INSTALLS += ProgramData

    # copy to make install
    CONFIG( release ) {
        AdditionalFiles.path = $${OUT_PWD}/$${DESTDIR}/ressource
        AdditionalFiles.files += ressource/xml/config.xml
        AdditionalFiles.files += ressource/xml/user.xml
        AdditionalFiles.files += ressource/xml/documentation.xml
        AdditionalFiles.files += ressource/install.nsi
        AdditionalFiles.files += release_notes/*.txt
        INSTALLS += AdditionalFiles
    }

    CONFIG( debug, debug|release ) {
        DEPLOY_TARGET = $$shell_quote($$shell_path($${OUT_PWD}/debug/$${TARGET}$${TARGET_CUSTOM_EXT}))
    } else {
        DEPLOY_TARGET = $$shell_quote($$shell_path($${OUT_PWD}/release/$${TARGET}$${TARGET_CUSTOM_EXT}))
    }

    QMAKE_POST_LINK += $${DEPLOY_COMMAND} $${DEPLOY_TARGET}


This is my complete Project file:


    QT       += core gui network widgets winextras

    TARGET = Application
    TEMPLATE = app

    TRANSLATIONS = \
        translation/Application_de.ts \
        translation/Application_en.ts \
        translation/Application_es.ts \
        translation/Application_fr.ts \
        translation/Application_nl.ts

    # Settings for favicon/tasksymbol
    win32:RC_ICONS += ressource/favicon/favicon.ico


    QMAKE_CXXFLAGS += -std=c++11
    DEFINES = QT_MESSAGELOGCONTEXT

    build_pass:CONFIG(debug, debug|release) {
        CONFIG += warn_on
    }

    #######################################
    # Build dir settings

    Release:DESTDIR = release
    Release:OBJECTS_DIR = release/.obj
    Release:MOC_DIR = release/.moc
    Release:RCC_DIR = release/.rcc
    Release:UI_DIR = release/.ui

    Debug:DESTDIR = debug
    Debug:OBJECTS_DIR = debug/.obj
    Debug:MOC_DIR = debug/.moc
    Debug:RCC_DIR = debug/.rcc
    Debug:UI_DIR = debug/.ui

    #######################################
    # Deploy Settings

    TARGET_CUSTOM_EXT = .exe
    DEPLOY_COMMAND = windeployqt

    ProgramData.path = C:/ProgramData/Application
    ProgramData.files += ressource/xml/config.xml
    ProgramData.files += ressource/xml/user.xml
    ProgramData.files += ressource/xml/documentation.xml
    INSTALLS += ProgramData

    # copy to make install
    CONFIG( release ) {
        AdditionalFiles.path = $${OUT_PWD}/$${DESTDIR}/ressource
        AdditionalFiles.files += ressource/xml/config.xml
        AdditionalFiles.files += ressource/xml/user.xml
        AdditionalFiles.files += ressource/xml/documentation.xml
        AdditionalFiles.files += ressource/install.nsi
        AdditionalFiles.files += release_notes/*.txt
        INSTALLS += AdditionalFiles
    }

    CONFIG( debug, debug|release ) {
        DEPLOY_TARGET = $$shell_quote($$shell_path($${OUT_PWD}/debug/$${TARGET}$${TARGET_CUSTOM_EXT}))
    } else {
        DEPLOY_TARGET = $$shell_quote($$shell_path($${OUT_PWD}/release/$${TARGET}$${TARGET_CUSTOM_EXT}))
    }

    QMAKE_POST_LINK += $${DEPLOY_COMMAND} $${DEPLOY_TARGET}

    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which as 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

    #######################################
    # Main Project entry
    include ( src/app.pri)

    #######################################
    # Resource files

    RESOURCES += \
        ressource/Images/Images.qrc

    #######################################
    # Distfiles
    DISTFILES += \
        ressource/install.nsi \
        favicon.ico

    # XML Files
    DISTFILES += \
        ressource/config.xml \
        ressource/user.xml \    
        ressource/documentation.xml

    # Release Notes
    DISTFILES += \
        release_notes/4_2_0.txt \
        release_notes/4_2_3.txt \
        release_notes/4_3_0.txt \
        release_notes/Template.txt

    # Translation
    DISTFILES += \
        translation/convert_cute_TS_to_gnu_PO.sh \
        translation/convert_gnu_PO_to_cute_TS.sh

Output of windeployqt --list mapping for debug and release version: Output of windeployqt --list mapping for debug and release version

Has somebody an idea or an hint for me to find the error?

Thanks Sven Arno Jopen

3 Answers3

1

I can't explain why there are missing dlls, but I can tell you that you can manually force them by specifying them on the command line. In the example below, opengl and printsupport libraries are specifically called out to be copied. You will also notice that we use . as our target. This makes windeployqt look at all exe and dll files and see what they also need.

Example: windeployqt --opengl --printsupport .

jwernerny
  • 6,978
  • 2
  • 31
  • 32
0
  • I don't think you need those configurations unless windeployqt does not really work in debug mode. Note that almost all qt binaries include both debug and release binaries.

  • To force the tool for debug binaries use --debug , while --release generate release binaries.

windeployqt --debug --list mapping

Some options of the tool:

windeployqt:
  -?, -h, --help            Displays this help.
  -v, --version             Displays version information.
  --debug                   Assume debug binaries.
  --release                 Assume release binaries.
Mohammad Kanan
  • 4,452
  • 10
  • 23
  • 47
0

After I made a Update from Qt 5.9.1 to 5.10.1 and Creator from 4.50 to 4.5.1. the deployment tool works correctly... it seems that this was a version problem but because i didn't find the specific problem it's only speculative. Thanks for the answers!