Sunday, July 19, 2009

MinGW/gcc 4.4

The current version of Qt Creator (1.2.1) ships with a free compiler based on gcc 3.4.5 which is now 5 years old. This compiler is free, so I can't complain too much, but it generates EXE/DLL files which are much larger than their MSVC equivalents (usually 15%-20% larger, sometimes up to 50%) and, by all accounts, slower code. Qt Creator itself is built using MSVC, and I have also built Qt from source using MSVC in both shared and static forms (details on how to do this next week.) I tend to use the MinGW Qt toolset for debug builds (as the debugging helpers for gdb are better) and the static MSVC version of Qt for release builds.

However, there is a new version of the MinGW toolset which includes a shiny new version of gcc (v4.4). By all accounts this is a much faster compiler that generates better code. This toolset will hopefully ship with Qt 4.6.

Although MSVC is a superb compiler, I don't want to have to depend on it, so I look forward to gcc 4.4. Having versions of Qt built with different compilers is an interesting exercise for the user but is ultimately a pain in the arse to manage.

Note that disabling support for exception handling can mean smaller executables when building with gcc, but I haven't tried this and am not sure how I can specify the relevant compiler options from Qt Creator itself.

2 comments:

  1. http://bugreports.qt.nokia.com/browse/QTSDK-286

    Nokia Qt SDK Installer QTSDK-286
    Build Qt Creator with MinGW to enable the Qwt plugin
    Type: Suggestion
    Status: Closed
    Priority: Not Evaluated
    Resolution: Out of scope
    Affects Version/s: None
    Fix Version/s: None
    Description
    The Qt Creator that is delivered within qt-sdk-win-opensource-2010.05.exe is built with MSVC.
    I have used it to build the Qwt (per default with MinGW).
    The generated Qwt plugin qwt_designer_plugin.dll cannot be used with Qt Creator!

    (Workaround: The plugin works with the standalone designer.exe)

    (Rebuilding Qt Creator with MinGW would help, but would make adoption of Qt Creator by my colleagues much less likely.)

    ======

    November 30

    Daniel Molkentin commented on QTSDK-286 (Build Qt Creator with MinGW to enable the Qwt plugin) saying:
    For instance some Windows 7 COM notification APIs that we are using to report progress and error. We made sure Creator will compile fine with MinGW (with notable exception of the resource file, at least last time I tried it required to change the path to unix-style slashes there). But of course we don't want to lose that functionality, so we can't use MinGW for the common builds.

    Robert Pollak commented on QTSDK-286 (Build Qt Creator with MinGW to enable the Qwt plugin) saying:
    What are these lacking Windows APIs you mentioned? I had no problems rebuilding Qt Creator with MinGW, see my report at http://www.qtforum.org/article/34938/compile-qtcreator-with-mingw.html#post111534.

    Daniel Molkentin closed QTSDK-286 (Build Qt Creator with MinGW to enable the Qwt plugin) saying:
    Qt Creator in the SDK is built with MSVC for technical reasons (MinGW lacks Windows APIs that Creator links to).

    Because of this, linking in designer plugins is not a supported use case.

    November 18

    Maurice Kalinowski changed the Assignee to 'Daniel Molkentin' on QTSDK-286 (Build Qt Creator with MinGW to enable the Qwt plugin)
    November 15

    Robert Pollak created QTSDK-286 (Build Qt Creator with MinGW to enable the Qwt plugin)

    ReplyDelete
  2. I liked your article, I will share your article to everyone!!




    RS gold|Diablo 3 Gold|Buy RS gold|WoW Gold

    ReplyDelete