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.3k 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.
  • JKSHJ Offline
    JKSHJ Offline
    JKSH
    Moderators
    wrote on last edited by
    #14

    Try using hard-coded paths first and see if you can get that to work. After you succeed, replace the hard-coded paths with variables.

    (I haven't used INSTALLS before and don't currently have access to a computer to try it myself)

    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

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

      Now using:

      C:\Qt\5.7\mingw53_32\bin
      

      Same results.

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #16

        well I was under the impression that make install was a unix thing as doc mentioned but
        then i read that mingw-make does have "install". I have however never tried it.

        But the plugandpaint example has

        target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint
        INSTALLS += target
        which maps to
        C:/Qt/Examples/Qt-5.7/widgets/tools/plugandpaint
        But nothing is copied there so Im not sure it does work.

        kshegunovK 1 Reply Last reply
        0
        • mrjjM mrjj

          well I was under the impression that make install was a unix thing as doc mentioned but
          then i read that mingw-make does have "install". I have however never tried it.

          But the plugandpaint example has

          target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint
          INSTALLS += target
          which maps to
          C:/Qt/Examples/Qt-5.7/widgets/tools/plugandpaint
          But nothing is copied there so Im not sure it does work.

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

          @mrjj said in copying .dlls into target directory:

          well I was under the impression that make install was a unix thing as doc mentioned but

          No, it's a make thing. Any self-respecting make implementation (including MS's nmake) should provide the install target out of the box. :)

          But the plugandpaint example has

          Well, how did you install? Did you call make install (or equivalent) from the Qt source's base path? If not, you've erred, because there's a chain of pro files (and mkspecs and other goodies that get included and ultimately the QT_INSTALL_EXAMPLES is set for you). But anyway, that's another matter altogether.

          @mzimmers

          I suggest you run qmake manually with -d or -d -d to get some debug info back. It is possible that the qmake's makefile generator doesn't respect the INSTALLS variable (although I see no reason it shouldn't).

          Kind regards.

          Read and abide by the Qt Code of Conduct

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

            @kshegunov - thank you for the suggestion. I tried this and got ~6700 error messages; I'm not sure I did it correctly.

            I do have another question: my build steps are to run make first, then qmake. If qmake is a "meta-make" tool, shouldn't the order be 1) qmake and 2) make?

            Thank you.

            jsulmJ 1 Reply Last reply
            0
            • mzimmersM mzimmers

              @kshegunov - thank you for the suggestion. I tried this and got ~6700 error messages; I'm not sure I did it correctly.

              I do have another question: my build steps are to run make first, then qmake. If qmake is a "meta-make" tool, shouldn't the order be 1) qmake and 2) make?

              Thank you.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #19

              @mzimmers Yes qmake should be the first one

              https://forum.qt.io/topic/113070/qt-code-of-conduct

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

                Well, somehow they got switched (I probably fat-fingered it). I put them in the correct order (qmake, make, make install) and still it doesn't copy the files. Here's the compiler output:

                08:42:17: Running steps for project storefile_client...
                08:42:17: Configuration unchanged, skipping qmake step.
                08:42:17: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" 
                C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug
                mingw32-make[1]: Entering directory 'C:/Users/mzimmers/Wideband/Peninsula/build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
                g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++11 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -I..\storefile_client -I. -I..\ARM\inc -IC:\Qt\5.7\mingw53_32\mkspecs\win32-g++  -o debug\storefile_client.o ..\storefile_client\storefile_client.cpp
                g++ -Wl,-subsystem,console -mthreads -o debug\storefile.exe debug/storefile_client.o  "C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86\ws2_32.lib" 
                mingw32-make[1]: Leaving directory 'C:/Users/mzimmers/Wideband/Peninsula/build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
                08:42:18: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
                08:42:18: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" install
                C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug install
                mingw32-make[1]: Entering directory 'C:/Users/mzimmers/Wideband/Peninsula/build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
                **mingw32-make[1]: Nothing to be done for 'install'.**
                mingw32-make[1]: Leaving directory 'C:/Users/mzimmers/Wideband/Peninsula/build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
                08:42:19: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
                08:42:19: Elapsed time: 00:02.
                

                To my layman eyes, it's looking more like the make that comes with mingw doesn't honor installs?

                kshegunovK 1 Reply Last reply
                0
                • mzimmersM mzimmers

                  Well, somehow they got switched (I probably fat-fingered it). I put them in the correct order (qmake, make, make install) and still it doesn't copy the files. Here's the compiler output:

                  08:42:17: Running steps for project storefile_client...
                  08:42:17: Configuration unchanged, skipping qmake step.
                  08:42:17: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" 
                  C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug
                  mingw32-make[1]: Entering directory 'C:/Users/mzimmers/Wideband/Peninsula/build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
                  g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++11 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -I..\storefile_client -I. -I..\ARM\inc -IC:\Qt\5.7\mingw53_32\mkspecs\win32-g++  -o debug\storefile_client.o ..\storefile_client\storefile_client.cpp
                  g++ -Wl,-subsystem,console -mthreads -o debug\storefile.exe debug/storefile_client.o  "C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86\ws2_32.lib" 
                  mingw32-make[1]: Leaving directory 'C:/Users/mzimmers/Wideband/Peninsula/build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
                  08:42:18: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
                  08:42:18: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" install
                  C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug install
                  mingw32-make[1]: Entering directory 'C:/Users/mzimmers/Wideband/Peninsula/build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
                  **mingw32-make[1]: Nothing to be done for 'install'.**
                  mingw32-make[1]: Leaving directory 'C:/Users/mzimmers/Wideband/Peninsula/build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
                  08:42:19: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
                  08:42:19: Elapsed time: 00:02.
                  

                  To my layman eyes, it's looking more like the make that comes with mingw doesn't honor installs?

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

                  Honestly, I have no idea. Could you attach the make file and the pro you're currently using?

                  Read and abide by the Qt Code of Conduct

                  1 Reply Last reply
                  0
                  • mzimmersM Offline
                    mzimmersM Offline
                    mzimmers
                    wrote on last edited by kshegunov
                    #22

                    @kshegunov : I don't know how to attach files, so I uploaded them to here.

                    You should be able to view and/or download from there. If not, please let me know.

                    Thanks...

                    kshegunovK 1 Reply Last reply
                    0
                    • mzimmersM mzimmers

                      @kshegunov : I don't know how to attach files, so I uploaded them to here.

                      You should be able to view and/or download from there. If not, please let me know.

                      Thanks...

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

                      I don't know how to attach files

                      That's what I meant - upload and post the link.

                      From what I can see in the makefile your install target is empty (FORCE goes to the end):

                      install:  FORCE
                      

                      And there's something suspicious about the .pro, you've commented INSTALLS += libs_to_copy and used INSTALLS += C:\Qt\5.7\mingw53_32\bin\libgcc_s_dw2-1.dll instead.

                      I suggest setting a hard path (not through a var) for the libs_to_copy contents and trying with INSTALLS += libs_to_copy. After modifying the file, don't forget to run qmake and then make, make install.

                      Read and abide by the Qt Code of Conduct

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

                        I tried this:

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

                        and I get this error:

                        :-1: warning: libs_to_copy.path is not defined: install target not created

                        When I do this:
                        libs_to_copy.files = $$(QMAKE_LIBDIR_QT)/libgcc_s_dw2-1.dll
                        libs_to_copy.path = $$(OUT_PWD)/$$(OUTDIR)
                        INSTALLS += libs_to_copy

                        I don't get the error, but the file doesn't copy.

                        kshegunovK 1 Reply Last reply
                        0
                        • mzimmersM mzimmers

                          I tried this:

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

                          and I get this error:

                          :-1: warning: libs_to_copy.path is not defined: install target not created

                          When I do this:
                          libs_to_copy.files = $$(QMAKE_LIBDIR_QT)/libgcc_s_dw2-1.dll
                          libs_to_copy.path = $$(OUT_PWD)/$$(OUTDIR)
                          INSTALLS += libs_to_copy

                          I don't get the error, but the file doesn't copy.

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

                          @mzimmers said in Copying .dlls into target directory:

                          libs_to_copy.files = $$(QMAKE_LIBDIR_QT)/libgcc_s_dw2-1.dll
                          libs_to_copy.path = $$(OUT_PWD)/$$(OUTDIR)
                          INSTALLS += libs_to_copy
                          

                          I don't get the error, but the file doesn't copy.

                          What about this:

                          libs_to_copy.files = C:/Qt/5.7/mingw53_32/bin/libgcc_s_dw2-1.dll
                          libs_to_copy.path = $$(OUT_PWD)
                          
                          INSTALLS += libs_to_copy
                          

                          ?

                          Alternatively you could try to add an additional target.

                          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:

                            libs_to_copy.files = $$(QMAKE_LIBDIR_QT)/libgcc_s_dw2-1.dll
                            libs_to_copy.path = $$(OUT_PWD)/$$(OUTDIR)
                            INSTALLS += libs_to_copy
                            

                            I don't get the error, but the file doesn't copy.

                            What about this:

                            libs_to_copy.files = C:/Qt/5.7/mingw53_32/bin/libgcc_s_dw2-1.dll
                            libs_to_copy.path = $$(OUT_PWD)
                            
                            INSTALLS += libs_to_copy
                            

                            ?

                            Alternatively you could try to add an additional target.

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

                            @kshegunov said in Copying .dlls into target directory:

                            @mzimmers said in Copying .dlls into target directory:

                            libs_to_copy.files = $$(QMAKE_LIBDIR_QT)/libgcc_s_dw2-1.dll
                            libs_to_copy.path = $$(OUT_PWD)/$$(OUTDIR)
                            INSTALLS += libs_to_copy
                            

                            I don't get the error, but the file doesn't copy.

                            What about this:

                            libs_to_copy.files = C:/Qt/5.7/mingw53_32/bin/libgcc_s_dw2-1.dll
                            libs_to_copy.path = $$(OUT_PWD)
                            
                            INSTALLS += libs_to_copy
                            

                            ?

                            That gives me this error:

                            :-1: warning: libs_to_copy.path is not defined: install target not created

                            Alternatively you could try to add an additional target.

                            I may have to fall back to this, if it turns out that the INSTALLS directive doesn't work.

                            Thanks...

                            kshegunovK 1 Reply Last reply
                            0
                            • BuckwheatB Offline
                              BuckwheatB Offline
                              Buckwheat
                              wrote on last edited by mrjj
                              #27

                              @mzimmers ... Your solution for copying looks pretty good. I am going to remember it. You mentioned modifying DESTDIR. I actually prefer doing that as well as setting the MOC_DIR and OBJECTS_DIR to make the build where I know things are located. It also makes it clean. When doing this, I turn off the shadow build into that horrendously long path. My structure is typically as follows (only release config):

                              <root>
                                 bin
                                    plugins
                                    ,,,
                                 build
                                    <subproject>
                                       release
                                          moc
                                          obj
                                    ...
                                    <main app>
                                       release
                                          moc
                                          obj
                                 lib
                                    release
                              

                              As you can see it is relatively clean and you know where things are built. I use MSYS2 for development because I can get 32 and 64 bit development. QtCreator 4.1.x for IDE.

                              I copy my 3rd party DLLs (except MSYS) into bin for testing. Typically I have only needed a few MSYS dlls so it is not too hateful.

                              [edit: code tags added: mrjj]

                              Dave Fileccia

                              BuckwheatB 1 Reply Last reply
                              0
                              • BuckwheatB Buckwheat

                                @mzimmers ... Your solution for copying looks pretty good. I am going to remember it. You mentioned modifying DESTDIR. I actually prefer doing that as well as setting the MOC_DIR and OBJECTS_DIR to make the build where I know things are located. It also makes it clean. When doing this, I turn off the shadow build into that horrendously long path. My structure is typically as follows (only release config):

                                <root>
                                   bin
                                      plugins
                                      ,,,
                                   build
                                      <subproject>
                                         release
                                            moc
                                            obj
                                      ...
                                      <main app>
                                         release
                                            moc
                                            obj
                                   lib
                                      release
                                

                                As you can see it is relatively clean and you know where things are built. I use MSYS2 for development because I can get 32 and 64 bit development. QtCreator 4.1.x for IDE.

                                I copy my 3rd party DLLs (except MSYS) into bin for testing. Typically I have only needed a few MSYS dlls so it is not too hateful.

                                [edit: code tags added: mrjj]

                                BuckwheatB Offline
                                BuckwheatB Offline
                                Buckwheat
                                wrote on last edited by
                                #28

                                @Buckwheat I wish I knew how to make indents in the forum ;D

                                Dave Fileccia

                                mrjjM 1 Reply Last reply
                                0
                                • BuckwheatB Buckwheat

                                  @Buckwheat I wish I knew how to make indents in the forum ;D

                                  mrjjM Offline
                                  mrjjM Offline
                                  mrjj
                                  Lifetime Qt Champion
                                  wrote on last edited by mrjj
                                  #29

                                  @Buckwheat
                                  use the code tag ``` ( before and after)
                                  and it wont eat indentation :)

                                  BuckwheatB 1 Reply Last reply
                                  0
                                  • mrjjM mrjj

                                    @Buckwheat
                                    use the code tag ``` ( before and after)
                                    and it wont eat indentation :)

                                    BuckwheatB Offline
                                    BuckwheatB Offline
                                    Buckwheat
                                    wrote on last edited by
                                    #30

                                    @mrjj Thanks!

                                    Dave Fileccia

                                    1 Reply Last reply
                                    0
                                    • mzimmersM mzimmers

                                      @kshegunov said in Copying .dlls into target directory:

                                      @mzimmers said in Copying .dlls into target directory:

                                      libs_to_copy.files = $$(QMAKE_LIBDIR_QT)/libgcc_s_dw2-1.dll
                                      libs_to_copy.path = $$(OUT_PWD)/$$(OUTDIR)
                                      INSTALLS += libs_to_copy
                                      

                                      I don't get the error, but the file doesn't copy.

                                      What about this:

                                      libs_to_copy.files = C:/Qt/5.7/mingw53_32/bin/libgcc_s_dw2-1.dll
                                      libs_to_copy.path = $$(OUT_PWD)
                                      
                                      INSTALLS += libs_to_copy
                                      

                                      ?

                                      That gives me this error:

                                      :-1: warning: libs_to_copy.path is not defined: install target not created

                                      Alternatively you could try to add an additional target.

                                      I may have to fall back to this, if it turns out that the INSTALLS directive doesn't work.

                                      Thanks...

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

                                      @mzimmers said in Copying .dlls into target directory:

                                      That gives me this error:
                                      :-1: warning: libs_to_copy.path is not defined: install target not created

                                      Sorry, I might've mislead you. Try with:

                                      libs_to_copy.path = $$OUT_PWD
                                      

                                      Notice the lack of parenthesis. It's a bit cumbersome like this, but I don't have a windows machine on hand to test. If you continue to get an error run qmake with -d and attach the output, e.g.

                                      qmake -d myproject.pro
                                      

                                      Read and abide by the Qt Code of Conduct

                                      mzimmersM 1 Reply Last reply
                                      1
                                      • kshegunovK kshegunov

                                        @mzimmers said in Copying .dlls into target directory:

                                        That gives me this error:
                                        :-1: warning: libs_to_copy.path is not defined: install target not created

                                        Sorry, I might've mislead you. Try with:

                                        libs_to_copy.path = $$OUT_PWD
                                        

                                        Notice the lack of parenthesis. It's a bit cumbersome like this, but I don't have a windows machine on hand to test. If you continue to get an error run qmake with -d and attach the output, e.g.

                                        qmake -d myproject.pro
                                        
                                        mzimmersM Offline
                                        mzimmersM Offline
                                        mzimmers
                                        wrote on last edited by
                                        #32

                                        @kshegunov said in Copying .dlls into target directory:

                                        Notice the lack of parenthesis. It's a bit cumbersome like this, but I don't have a windows machine on hand to test. If you continue to get an error run qmake with -d and attach the output, e.g.
                                        qmake -d myproject.pro

                                        Here's the output:

                                        link text

                                        LOTS of stuff there, and I don't understand most of it.

                                        kshegunovK 1 Reply Last reply
                                        0
                                        • mzimmersM mzimmers

                                          @kshegunov said in Copying .dlls into target directory:

                                          Notice the lack of parenthesis. It's a bit cumbersome like this, but I don't have a windows machine on hand to test. If you continue to get an error run qmake with -d and attach the output, e.g.
                                          qmake -d myproject.pro

                                          Here's the output:

                                          link text

                                          LOTS of stuff there, and I don't understand most of it.

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

                                          @mzimmers said in Copying .dlls into target directory:

                                          and I don't understand most of it.

                                          No one does, perhaps with the exception of the qmake's developers. ;)
                                          Anyway, there seems to be a problem with the paths:

                                          DEBUG 1: C:/Users/mzimmers/Wideband/Peninsula/storefile_client/storefile_client.pro:17: libs_to_copy.files := /libgcc_s_dw2-1.dll
                                          DEBUG 1: C:/Users/mzimmers/Wideband/Peninsula/storefile_client/storefile_client.pro:19: libs_to_copy.path := C:/Users/mzimmers/Wideband/Peninsula/build-storefile_client-Desktop_Qt_5_7_0_MinGW_32bit-Debug
                                          ...
                                          DEBUG 1: Dependency Directories: ..\storefile_client :: . :: ..\ARM\inc :: C:\Qt\5.7\mingw53_32\mkspecs\win32-g++
                                          DEBUG 1: c:\Users\qt\work\qt\qtbase/qmake/generators/makefile.cpp:321 Failure to find /libgcc_s_dw2-1.dll in vpath ()
                                          DEBUG 1: no definition for install libs_to_copy: install target not created
                                          

                                          See that the dll file's path is truncated for some reason.

                                          Read and abide by the Qt Code of Conduct

                                          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