July 7, 2011

Luca Luca
Ant Farmer
589 posts

Copy .dll from .pro file [Solved]

 

Hi all,
I’m developing a Qt windows application.
In my .pro file I have:

  1. ..
  2. ..
  3. DESTDIR = ../bin
  4. ...
  5. ...

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 ?

4 replies

July 7, 2011

cincirin cincirin
Ant Farmer
387 posts

maybe this faq [developer.qt.nokia.com] will help you

July 7, 2011

Luca Luca
Ant Farmer
589 posts
cincirin wrote:
maybe this faq [developer.qt.nokia.com] will help you

Thanks, it works.
This is my .pro :

  1. ...
  2. ...
  3. QMAKE_POST_LINK = copy c:\QtSDK\Desktop\Qt\4.7.3\mingw\lib\Qt*.dll ..\bin\
  4. ...
  5. ...

Now it should be interesting if Qt has a “variable” that already contains:

  1. c:\QtSDK\Desktop\Qt\4.7.3\mingw\lib\

so I can use for example:
  1. QMAKE_POST_LINK = copy QT_LIBRARY\Qt*.dll ..\bin\

Is it possible?

July 7, 2011

cincirin cincirin
Ant Farmer
387 posts

yes …

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

July 7, 2011

Luca Luca
Ant Farmer
589 posts

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

I found this that do the works:

  1. QMAKE_POST_LINK = copy $${QMAKE_LIBDIR_QT}\Qt*.dll ..\bin\

 
  ‹‹ ShortCut doesn’t work on MAC OS X      Resize dialog when it’s child table resizes ››

You must log in to post a reply. Not a member yet? Register here!