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. Copying .dlls into target directory
Forum Updated to NodeBB v4.3 + New Features

Copying .dlls into target directory

Scheduled Pinned Locked Moved Unsolved General and Desktop
43 Posts 7 Posters 28.4k Views 4 Watching
  • 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #34

    Well, look at that...it sure is.

    I don't know what to make of that (so to speak). Is it possible we've uncovered a bug?

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #35

      It's probably one of those lovely windows gotchas, I think it does not like the dot in 5.7, try adding quotes

      libs_to_copy.files = "C:/Qt/5.7/mingw53_32/bin/libgcc_s_dw2-1.dll"

      and make sure you rerun qmake!

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      2
      • mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #36

        Hi, Vronin -

        This is somewhat embarrassing. I tried your suggestion, and it worked. I looked at the compiler output and actually saw the xcopy command, and the file did copy.

        Unfortunately, it was copying to:

        C:\Users\mzimmers\build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug

        instead of to:

        C:\Users\mzimmers\build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug\debug

        So, I went in and fiddled with it, to no avail. I tried to put it back so it would at least re-copy, and...I can't make it work again!!

        I'm still encouraged, because it shows that the INSTALLS part of MinGW make does work. It's just a matter of getting the syntax in the .pro file correct.

        I'm trying to understand the libs_to_copy construct that I copied from somewhere else. This doesn't seem to be an ordinary qmake variable, and I can't get it to display using message(). Can you possibly point me to an explanation of it?

        Thanks a lot...I do think we're getting close.

        1 Reply Last reply
        1
        • mzimmersM Offline
          mzimmersM Offline
          mzimmers
          wrote on last edited by
          #37

          Found it!

          The problem was the trailing backslash in the definition of:

          libs_to_copy.path = "C:\Users\mzimmers\Wideband\Peninsula\build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug\"
          

          This occurs whether or not I enclose the path in double quotes. Seems like a bug to me...anyone disagree?

          There's also the issue of why this line:

          libs_to_copy.path = $$(OUT_PWD)
          

          results in an error message ":-1: warning: libs_to_copy.path is not defined: install target not created."

          But, at least I've solved the problem that prompted me to start this thread.

          THANK YOU TO EVERYONE WHO PARTICIPATED IN THIS.

          kshegunovK 1 Reply Last reply
          2
          • mzimmersM mzimmers

            Found it!

            The problem was the trailing backslash in the definition of:

            libs_to_copy.path = "C:\Users\mzimmers\Wideband\Peninsula\build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug\"
            

            This occurs whether or not I enclose the path in double quotes. Seems like a bug to me...anyone disagree?

            There's also the issue of why this line:

            libs_to_copy.path = $$(OUT_PWD)
            

            results in an error message ":-1: warning: libs_to_copy.path is not defined: install target not created."

            But, at least I've solved the problem that prompted me to start this thread.

            THANK YOU TO EVERYONE WHO PARTICIPATED IN THIS.

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #38

            @mzimmers said in Copying .dlls into target directory:

            $$(OUT_PWD)

            It's not defined. Try $$OUT_PWD instead.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            1
            • mzimmersM Offline
              mzimmersM Offline
              mzimmers
              wrote on last edited by mzimmers
              #39

              @kshegunov : yes, that was it. Thank you. I guess I'm still not clear on the rules of parsing variables.

              I do have one remaining glitch: one of the three files I want to copy produces an error:

              copy /y C:\Qt\5.7\mingw53_32\bin\libgcc_s_dw2-1.dll C:\Users\mzimmers\Wideband\Peninsula\build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug\debug
                      1 file(s) copied.
              copy /y C:\Qt\5.7\mingw53_32\bin\libwinpthread-1.dll C:\Users\mzimmers\Wideband\Peninsula\build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug\debug
                      1 file(s) copied.
              copy /y C:\Qt\5.7\mingw53_32\bin\libstdc++-6.dll C:\Users\mzimmers\Wideband\Peninsula\build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug\debug
              The system cannot find the file specified.
              

              This file fails to copy whether it's the first, second or last file in the list. It also occurs whether I form libs_to_copy.files with three assignments, or one (multi-line).
              Somehow I suspect it's the "+" in the filename. I made a copy of this dll without the "+" characters, and it worked. Is there some way to escape them in the string?"

              Found this: it's a known problem. Not sure what to make of it...

              kshegunovK 1 Reply Last reply
              0
              • VRoninV Offline
                VRoninV Offline
                VRonin
                wrote on last edited by
                #40

                This is due to a bug in Qt: https://bugreports.qt.io/browse/QTBUG-16372 but the solution is not easy to implement, see https://codereview.qt-project.org/#/c/85161/
                This was the reason I first started using CMake as a build tool instead of qmake and now I wouldn't go back.

                KDE is using Cmake.

                An alternative (but I never tried it) is Qt Build system: http://doc.qt.io/qbs/

                "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                ~Napoleon Bonaparte

                On a crusade to banish setIndexWidget() from the holy land of Qt

                1 Reply Last reply
                0
                • mzimmersM mzimmers

                  @kshegunov : yes, that was it. Thank you. I guess I'm still not clear on the rules of parsing variables.

                  I do have one remaining glitch: one of the three files I want to copy produces an error:

                  copy /y C:\Qt\5.7\mingw53_32\bin\libgcc_s_dw2-1.dll C:\Users\mzimmers\Wideband\Peninsula\build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug\debug
                          1 file(s) copied.
                  copy /y C:\Qt\5.7\mingw53_32\bin\libwinpthread-1.dll C:\Users\mzimmers\Wideband\Peninsula\build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug\debug
                          1 file(s) copied.
                  copy /y C:\Qt\5.7\mingw53_32\bin\libstdc++-6.dll C:\Users\mzimmers\Wideband\Peninsula\build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug\debug
                  The system cannot find the file specified.
                  

                  This file fails to copy whether it's the first, second or last file in the list. It also occurs whether I form libs_to_copy.files with three assignments, or one (multi-line).
                  Somehow I suspect it's the "+" in the filename. I made a copy of this dll without the "+" characters, and it worked. Is there some way to escape them in the string?"

                  Found this: it's a known problem. Not sure what to make of it...

                  kshegunovK Offline
                  kshegunovK Offline
                  kshegunov
                  Moderators
                  wrote on last edited by
                  #41

                  @mzimmers said in Copying .dlls into target directory:

                  I guess I'm still not clear on the rules of parsing variables.

                  $(XXX) is the environment variable XXX, while $XXX is the qmake variable XXX.

                  Read and abide by the Qt Code of Conduct

                  mzimmersM 1 Reply Last reply
                  0
                  • kshegunovK kshegunov

                    @mzimmers said in Copying .dlls into target directory:

                    I guess I'm still not clear on the rules of parsing variables.

                    $(XXX) is the environment variable XXX, while $XXX is the qmake variable XXX.

                    mzimmersM Offline
                    mzimmersM Offline
                    mzimmers
                    wrote on last edited by
                    #42

                    @kshegunov : thank you. So, what exactly is the libs_to_copy construct that I'm using? I can't find any documentation on that.

                    kshegunovK 1 Reply Last reply
                    0
                    • mzimmersM mzimmers

                      @kshegunov : thank you. So, what exactly is the libs_to_copy construct that I'm using? I can't find any documentation on that.

                      kshegunovK Offline
                      kshegunovK Offline
                      kshegunov
                      Moderators
                      wrote on last edited by
                      #43

                      @mzimmers
                      It's just a variable as far as I know. You can name it however you like and you (should) be able to use more than one as well. E.g.:

                      mingw_installs.files = "C:/Qt/5.7/mingw53_32/bin/libgcc_s_dw2-1.dll" "C:/Qt/5.7/mingw53_32/bin/stdc++6.dll" 
                      mingw_installs.path = $$OUT_PWD
                      
                      myown_installs.files = "C:/AdditionalDepDir/somefileIneed.txt"
                      myown_installs.path = $$OUT_PWD
                      
                      INSTALLS += mingw_installs myown_installs
                      

                      (do take my qmake knowledge with a grain of salt, though, I'm by no means an expert)

                      Read and abide by the 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