I'm a little rusty on my C++ because I'm a PHP dev, and only messed around with C/C++ in college, and C# on one project ten years ago. A C++ developer in my company is using the Qt library. He's saying that we're going to need to put about 15MB of Qt library stuff in a setup.exe, which seems a bit large to me.
Is there a way to change the Visual Studio C++ compiler settings so that it only picks and chooses out of the Qt library that which it actually uses, and its dependencies, and doesn't need to ship this large 15MB Qt library stuff in the setup.exe?
You can compile Qt statically. It may or may not reduce the size of your final project. You'd need to figure it out on a case-by-case basis. My experience has been that it's not worth the enormous link times when link time code generation (LTCG) is enabled. LTCG is usually worth it as it can not only speed things up, but often it also reduces code size.
As a practical measure, you can use a dynamic Qt library for the debug builds, only use the static Qt for release builds. You'd end up adding two Qt "versions" and two Qt kits to Qt Creator. In Creator parlance, a Qt "version" is merely a Qt build. So if you have two builds (one static, one shared library) of a version of Qt, they'll be two "versions" in spite of sharing a version number.
There's a new benefit available as of Qt 5 when it comes to simple graphical applications. If you don't care about the entire Widget machinery and can paint a simple window yourself, it's quite possible to have an application that uses the core
and gui
modules without using the widgets
module. See the raster window example. This saves a couple megabytes worth of a module. Conceptually it's like having a bare-bones MS-DOS application with a good graphics engine :)
In Qt 4 there was no separate widgets
module, it was bundled within the gui
module.