[Qt-creator] Some issues concerning dlls in the qt sdk
Adam Higerd
ahigerd at timeips.com
Tue Mar 24 14:17:41 CET 2009
Yue Wang wrote:
> - In QT SDK, all the demos and examples are included. Usually they are
> only for presentation, not for debugging, so it is better to provide
> the release build only. However, all the examples provide both release
> build and debug build, which make the directory too large. We should
> remove the useless debug build them to save space. (There are about
> 100 examples, each debug build occupies 3MB)
Of all the points you make in your e-mail, this is the one I agree with
most. What further annoys me is that even after four years you can't
disable building the demos and examples in Qt for Windows even though
you can on X11, Mac, and embedded.
> - Usually developers use QT for software development, not for
> debugging QT (only Nokia guys develop QT). Wouldn't it be better to
> remove the debug library completely?
Actually, that's not true at all. The debug symbols are very useful even
for normal non-Nokia developers. I know I've traced through Qt code
before in the process of debugging my own applications. Sometimes it's
vital to understand the control flow that invokes your functions. By all
means the SDK should absolutely ship with debug builds.
> - When debugging in QT Creator under Windows, gdb might take half a
> minute to load all the symbols in the library. Usually one step of
> execution takes about 10 seconds, which makes the debugging feature
> unusable.This is because the debug builds of the apps are linked to
> debug build of the library, which are very huge (for example, debug
> build of QtGui is 74MB). As I said in the previous point, usually
> developers only need to test their own apps, not QT. So it will be
> much better to link debug version of app to release version of QT
> library. This will save a lot of loading time. Stepping the lines also
> becomes much more efficient. I think this should be set default in QT
> Creator when building the apps on Windows systems.
The first load of the application is definitely going to take a while
because it has to load all of the debugging symbols. There's a "Fast
Debugger Start" option in the Debug menu you can use to help with that,
and I hear that Creator 1.1 will be including an option to restart an
already-loaded instance in the debugger rather than requiring it to be
reloaded with every run.
> - all the static library file (libqtxxx.a) are included in
> \Qt\2009.01\qt\lib. But I find no way to build a static version of my
> app. How? And I also think we can leave a "static build" option in QT
> Creator, or remove the static library completely.
This is a very, very common misconception about Windows libraries. The
.a (or .lib if you're using MSVC) files bundled with the .dll files are
not static libraries; they're stubs that contain the information the
linker needs to load the dynamic part of the library. (On UNIX, these
aren't necessary because the compiler is able to generate this data on
demand.)
As far as compiling Qt applications statically, that requires REAL
static libraries; Creator can do this if you point it to a
statically-compiled installation of Qt.
> - remove duplicated dlls
I do agree that I'm fairly puzzled as to why the SDK includes
three fully duplicated versions of the libraries on Windows.
/s/ Adam
More information about the Qt-creator-old
mailing list