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. Why "Patching Qt5Cored.dll..." when building the project ?

Why "Patching Qt5Cored.dll..." when building the project ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 5 Posters 7.3k 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
    Pamplemousse MK 2
    wrote on 17 Oct 2016, 12:17 last edited by
    #1

    Hello,

    We worked for several years with Qt 4.7.3 for Windows Mingw. My team starts to migrate our projects to Qt 5.5.0. After a lot of changes, we succeeded. Now we would like to migrate to the long-term release 5.6, especially the last 5.6.2.

    After installing the open source SDK, I opened our .pro file, clean and build it. I get this error:

    Adding Qt5Svg for qsvgicond.dll
    Direct dependencies: Qt5Core Qt5Gui Qt5Network Qt5Widgets
    All dependencies   : Qt5Core Qt5Gui Qt5Network Qt5Widgets
    To be deployed     : Qt5Core Qt5Gui Qt5Network Qt5Svg Qt5Widgets
    Qt5Cored.dll is up to date.
    Qt5Guid.dll is up to date.
    Updating Qt5Networkd.dll.
    Qt5Svgd.dll is up to date.
    Qt5Widgetsd.dll is up to date.
    libGLESV2d.dll is up to date.
    libEGLd.dll is up to date.
    D3Dcompiler_42.dll is up to date.
    opengl32sw.dll is up to date.
    libgcc_s_dw2-1.dll is up to date.
    libstdc++-6.dll is up to date.
    libwinpthread-1.dll is up to date.
    Patching Qt5Cored.dll...
    Unable to patch C:\xxx\debug\Qt5Cored.dll: Could not write to file
    

    Why does Qt try to patch Qt5Cored.dll ? We don't want to rebuild the Qt SDK, just use it as it is after a fresh SDK installation. We didn't had this problem with Qt 4 and Qt 5.5.0.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 17 Oct 2016, 15:37 last edited by
      #2

      Hi
      I have never seen that message from open a .pro file
      Maybe the .pro call windeploy ?
      https://github.com/eraxillan/windeployqt/blob/master/deployment.cpp
      static bool patchQtCore(const QString &path, QString *errorMessage)
      {
      if (optVerboseLevel)
      std::wcout << "Patching " << QFileInfo(path).fileName() << "...\n";
      ...

      Else I have zero ideas ?

      P 1 Reply Last reply 18 Oct 2016, 08:40
      2
      • M mrjj
        17 Oct 2016, 15:37

        Hi
        I have never seen that message from open a .pro file
        Maybe the .pro call windeploy ?
        https://github.com/eraxillan/windeployqt/blob/master/deployment.cpp
        static bool patchQtCore(const QString &path, QString *errorMessage)
        {
        if (optVerboseLevel)
        std::wcout << "Patching " << QFileInfo(path).fileName() << "...\n";
        ...

        Else I have zero ideas ?

        P Offline
        P Offline
        Pamplemousse MK 2
        wrote on 18 Oct 2016, 08:40 last edited by
        #3

        @mrjj Hello, you are right. We added QMAKE_POST_LINK += windeployqt $$DESTDIR/$${TARGET}.dll $$escape_expand(\n\t) in the .pro files.

        Shouldn't we use it ? We are new in Qt 5. Could windeploy need to patch some Qt DLL ? If so, perhaps shouldn't we use it.

        M 1 Reply Last reply 18 Oct 2016, 09:09
        1
        • P Pamplemousse MK 2
          18 Oct 2016, 08:40

          @mrjj Hello, you are right. We added QMAKE_POST_LINK += windeployqt $$DESTDIR/$${TARGET}.dll $$escape_expand(\n\t) in the .pro files.

          Shouldn't we use it ? We are new in Qt 5. Could windeploy need to patch some Qt DLL ? If so, perhaps shouldn't we use it.

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 18 Oct 2016, 09:09 last edited by
          #4

          @Pamplemousse-MK-2
          Well since we use and recommend the windeployqt to make the deployment folder,
          and i have never seen anything mention before about it,
          its safe to assume that
          its ok to do
          and normally just works as intended.

          So the actually error is "Could not write to file"
          so for some reason it fails to write there.

          Could you maybe run tool by hand and see if it gives more info.

          Maybe its just nothing - meaning sometimes the DLL is just loaded and hence locked for writing.

          Does it say write error even the very first time?

          P 1 Reply Last reply 18 Oct 2016, 16:32
          1
          • H Offline
            H Offline
            hskoglund
            wrote on 18 Oct 2016, 15:00 last edited by
            #5

            Hi, just want to add, it's correct that windeployqt wants to patch Qt5Core.dll (and its debug cousin Qt5Cored.dll). When copying Qt's .dlls from your installation directory it wants to get rid of ("neuter") a patch made earlier to Qt5Core(d).dll when you installed Qt: the path to Qt's installation directory.

            Here's an example of a windeployqt patch: from "qt_prfxpath=C:\Qt\5.7\msvc2013" to "qt_prfxpath=."

            1 Reply Last reply
            2
            • M mrjj
              18 Oct 2016, 09:09

              @Pamplemousse-MK-2
              Well since we use and recommend the windeployqt to make the deployment folder,
              and i have never seen anything mention before about it,
              its safe to assume that
              its ok to do
              and normally just works as intended.

              So the actually error is "Could not write to file"
              so for some reason it fails to write there.

              Could you maybe run tool by hand and see if it gives more info.

              Maybe its just nothing - meaning sometimes the DLL is just loaded and hence locked for writing.

              Does it say write error even the very first time?

              P Offline
              P Offline
              Pamplemousse MK 2
              wrote on 18 Oct 2016, 16:32 last edited by Pamplemousse MK 2
              #6

              @mrjj OK. I tried to execute windeployqt manually, and got the same problem. We face the problem on two computers: my workstation and a Windows server for our nightly builds.

              1 Reply Last reply
              0
              • P Offline
                P Offline
                Pamplemousse MK 2
                wrote on 19 Oct 2016, 11:12 last edited by
                #7

                Hi everyone,

                I tried to build an example of the SDK, the Calendar widget example. I build it in debug and in release in command line. Then I run windeployqt

                For the debug build, I still have the same problem.
                For the release build, the deploy was successful:

                C:\QtSDK\Qt-5.6.2\Examples\Qt-5.6\widgets\widgets\calendarwidget>windeployqt C:\
                QtSDK\Qt-5.6.2\Examples\Qt-5.6\widgets\widgets\calendarwidget\release
                C:\QtSDK\Qt-5.6.2\Examples\Qt-5.6\widgets\widgets\calendarwidget\release\calenda
                rwidget.exe 32 bit, release executable
                Adding Qt5Svg for qsvgicon.dll
                Direct dependencies: Qt5Core Qt5Gui Qt5Widgets
                All dependencies   : Qt5Core Qt5Gui Qt5Widgets
                To be deployed     : Qt5Core Qt5Gui Qt5Svg Qt5Widgets
                Qt5Core.dll is up to date.
                Qt5Gui.dll is up to date.
                Qt5Svg.dll is up to date.
                Qt5Widgets.dll is up to date.
                libGLESV2.dll is up to date.
                libEGL.dll is up to date.
                D3Dcompiler_42.dll is up to date.
                opengl32sw.dll is up to date.
                libgcc_s_dw2-1.dll is up to date.
                libstdc++-6.dll is up to date.
                libwinpthread-1.dll is up to date.
                Patching Qt5Core.dll...
                qsvgicon.dll is up to date.
                qdds.dll is up to date.
                qgif.dll is up to date.
                qicns.dll is up to date.
                qico.dll is up to date.
                qjpeg.dll is up to date.
                qsvg.dll is up to date.
                qtga.dll is up to date.
                qtiff.dll is up to date.
                qwbmp.dll is up to date.
                qwebp.dll is up to date.
                qwindows.dll is up to date.
                Creating qt_ca.qm...
                Creating qt_cs.qm...
                Creating qt_de.qm...
                Creating qt_en.qm...
                Creating qt_fi.qm...
                Creating qt_fr.qm...
                Creating qt_he.qm...
                Creating qt_hu.qm...
                Creating qt_it.qm...
                Creating qt_ja.qm...
                Creating qt_ko.qm...
                Creating qt_lv.qm...
                Creating qt_pl.qm...
                Creating qt_ru.qm...
                Creating qt_sk.qm...
                Creating qt_uk.qm...
                
                

                Am I allowed to patch the debug DLL of Qt ?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  scristall
                  wrote on 20 Oct 2016, 20:24 last edited by scristall
                  #8

                  We are having the exact same issue. We are running the following with Qt 5.6.2:

                  cmake -E env PATH=/path/to/qt/bin windeployqt.exe --debug --qmldir /path/to/qml /path/to/output/exec
                  

                  And get the same error:

                  Patching Qt5Cored.dll...
                  Unable to patch /path/to/output/Qt5Cored.dll: Could not write to file
                  

                  This does not happen on Qt 5.6.0, or when we use --release instead of --debug.

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    hskoglund
                    wrote on 20 Oct 2016, 22:54 last edited by
                    #9

                    Hi, I also use windeployqt to distribute my app to other computers, and because Microsoftdoes not like that you distribute the debug flavored dlls to other computers, I always switch to Release mode before windeployqt. Perhaps 5.6.2 was not tested properly for debug distributions...

                    1 Reply Last reply
                    1
                    • P Offline
                      P Offline
                      Pamplemousse MK 2
                      wrote on 3 Nov 2016, 14:33 last edited by
                      #10

                      Hello,

                      We decide to not use Qt 5.6.2, because we would like to use QChart, which is available in 5.7. We don't seem to have the same problem with 5.7.

                      1 Reply Last reply
                      0
                      • Paul ColbyP Offline
                        Paul ColbyP Offline
                        Paul Colby
                        wrote on 12 Jan 2017, 21:00 last edited by
                        #11

                        Just a small follow-up (hope that's okay, given that this is an older thread now...)

                        AppVeyor (which I use for CI/CD on a number of open source projects) recently updated their Qt 5.6 installation from Qt 5.6.1 to Qt 5.6.2, so I'm now seeing this issue too. The interesting thing is that while AppVeyor builds my Bipolar project against 38 different configurations (example buildset), there's only one that's failing: "QTDIR=C:\Qt\5.6\mingw49_32; Configuration: debug"

                        So it seems this issue is specific to Qt 5.6.2 + MinGW + Debug (no issues with 5.6.1, 5.7.x, 5.6.2 with MSVC, release, etc).

                        Since Qt 5.6 is a "long-term support" release, I'll see if there's an existing bug report for it, and add one if not.

                        Cheers.

                        1 Reply Last reply
                        1
                        • Paul ColbyP Offline
                          Paul ColbyP Offline
                          Paul Colby
                          wrote on 12 Jan 2017, 21:06 last edited by Paul Colby 1 Dec 2017, 21:06
                          #12

                          Ah, so it looks like it's a result of QTBUG-56616.

                          Cheers.

                          1 Reply Last reply
                          2

                          • Login

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