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. Copy .dll from .pro file [Solved]
Forum Updated to NodeBB v4.3 + New Features

Copy .dll from .pro file [Solved]

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 9.0k Views 1 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.
  • L Offline
    L Offline
    luca
    wrote on last edited by
    #1

    Hi all,
    I'm developing a Qt windows application.
    In my .pro file I have:
    @
    ..
    ..
    DESTDIR = ../bin
    ...
    ...
    @

    so when I build it I get the executable "myapp.exe" in ../bin directory .

    To execute it I need to set some environmental variables so that it can found the Qt dll but I don't like this so I usually copy Qt dll in my "bin" directory and the application start without problem.
    No I'd like to copy the Qt dll in bin directory automatically and not by hand.

    Is it possible to write something in my .pro so that when I build the application it also copy some file in ..bin directory ?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cincirin
      wrote on last edited by
      #2

      maybe "this faq":http://developer.qt.nokia.com/faq/answer/how_can_i_get_qmake_post_link_to_work_with_more_than_one_command_on_windows will help you

      1 Reply Last reply
      0
      • L Offline
        L Offline
        luca
        wrote on last edited by
        #3

        [quote author="cincirin" date="1310025479"]maybe "this faq":http://developer.qt.nokia.com/faq/answer/how_can_i_get_qmake_post_link_to_work_with_more_than_one_command_on_windows will help you[/quote]

        Thanks, it works.
        This is my .pro :
        @
        ...
        ...
        QMAKE_POST_LINK = copy c:\QtSDK\Desktop\Qt\4.7.3\mingw\lib\Qt*.dll ..\bin
        ...
        ...
        @

        Now it should be interesting if Qt has a "variable" that already contains:
        @
        c:\QtSDK\Desktop\Qt\4.7.3\mingw\lib
        @
        so I can use for example:
        @
        QMAKE_POST_LINK = copy QT_LIBRARY\Qt*.dll ..\bin
        @

        Is it possible?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cincirin
          wrote on last edited by
          #4

          yes ...

          @
          QT_LIBRARY = c:\QtSDK\Desktop\Qt\4.7.3\mingw\lib
          QMAKE_POST_LINK = copy $$QT_LIBRARY\Qt*.dll ..\bin
          @

          1 Reply Last reply
          0
          • L Offline
            L Offline
            luca
            wrote on last edited by
            #5

            Thanks,
            but I mean a Qt define already defined by Qt framwork.

            I found this that do the works:
            @
            QMAKE_POST_LINK = copy $${QMAKE_LIBDIR_QT}\Qt*.dll ..\bin
            @

            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