Finally figured out how to get a Windows executable compiled on one Windows machine to run correctly (with SVG icons) on another Windows VM without QT installed. Here are the steps:
- Build for release, and take the exe in the release folder of the project.
- Copy the following files from
c:\Qt\[release_date]\qt\bin\(NOT the \bin\ which is one folder further up the tree):
- Take the
\plugins\imageformatsfolder from the same location, and copy it into a
\plugins\folder alongside the executable. (This is all that's needed for my simple SVG test app; you may need other plugins too.)
- Create a text file called
qt.confin the same folder as the executable, and put this in it:
[Paths] Plugins = plugins/This tells the QT code to look for plugins in this subfolder of the main app. Otherwise it will look for a full QT installation on the target machine, and not find it. Plugins seem to be late-binding, and the app is able to fail gracefully (by not displaying SVG icons) if it can't find the plugins.
This works for an exe compiled on 64-bit Windows 7 or on 32-bit Windows XP, running on a separate 32-bit XP system.
I now have a clean XP VM provided by Greg, with only QT on it, for this kind of task. Now I need to see if I can make a Linux app portable in the same way; then it's Mac time.