Deployment on windows
-
Hi All,
I am using Qt SDK 5.0.2 and I have a little console project that running nicely within the Qt Creator environment. But now I want to take the compiled .exe file and run it on another PC.
I have been reading as many "how to deploy your app" in the forums/web as I can but have not found quite what I need to know to get going.
Mostly people are saying you need to add your .dll files into your project. So at the moment I am trying to achieve this by running my QT project via the .exe file that it produces (i.e. in standalone mode).
When I run my .exe it complains that it cant fine QtCored.dll. So I add this to the folder where my .exe is and that warning goes away, and I get warned about the next missing .dll.
My question is, how are people adding these .dlls to their projects? Do we just do as I have done and manually copy them into the output folder, or do we include then in our projects somehow?
I have a copy of dependency walker which helps me to find the .dlls that I need to find.
One further/relevant question: What does the "build --> deploy project" menu option to in Qt Creator? - mine is grey'ed out so I can't use it.
Thanks for any help.
-
Hi,
Did you add a deploy step ?
To deploy an application on windows, I've just followed the official documentation, i.e. take the libs for every module I use, then add the 3rd party non system libs etc... (It also depends on whether you build dynamically or statically). For this last step, Dependency Walker is a great help.
Don't forget the plugins ! Image formats, sql drivers etc... in the correct folders
Once everything is sorted, I use a package builder like InnoSetup (others are available) to make an installer.
Hope it helps
-
Hi SGaist,
I have not added a deploy step.... actually this is the first I have heard of this step!... I am totally missing this information!, where is the documentation for this stuff?, I think I am really just on step 1.
You said you "take the libs for each module you use" but what does that mean? - just include them in the .pro file?
Thanks
-
In the Projects panel, under run settings you have the deployment step but I can't remember the exact location of the documentation for this feature.
No, I mean that i go in the release build directory and copy in there each Qt lib for the modules I use:
- QtSql.dll if i use database connection
- QtNetwork.dll if i use networking
etc...
Once I have everything needed I make a build script for the installer using this information.
-
ah ha, ok, that basically answers my question! - I was starting to drag and drop all of the .dll files into my .exe directory, but then I thought that there may have been an easier way to to this!
Thanks for the Deployment Step, I found it... no Idea how to use it yet, but now I know where it is I can at least search for help on that too :)
-
Watch out when drag and dropping on windows, you might be moving the libs around rather than copying them and then... Well nothing will run anymore...
-
lol...thanks for the tip :) - I am a Qt newb, not a windows newb :o
But still... noted :)