[Qt-interest] Changing the toolchain in Qt Creator

Ross Bencina rossb-lists at audiomulch.com
Fri Jan 22 16:52:09 CET 2010


> 1. Do I need to compile the entire Qt library and Qt Creator with the
> microsoft compiler to be able to use it? I've downloaded the Qt SDK
> exe installer from the website.
> 2. If so, why? Why can't I choose another compiler from within Qt Creator?

Short answer: C++ has no ABI so you can't generally mix code compiled by 
different compilers.

Long answer:
Microsoft and mingw intermediate files are incompatible so in general, for 
any project Qt or not, you need to build the whole project and libs against 
the same toolchain. In some cases this can be avoided (in theory at least 
this is relatively easy with C dlls, C++ is another story since the compiler 
name mangling and calling conventions are also different). Another possible 
issue arises if your Qt DLLs are built with an MS C++ runtime and your app 
with a gcc runtime (or vis versa) you could have issues with memory 
allocator collisions etc.

As an aside, with MSVC it can be hard to even get things working if the libs 
and app aren't compiled with the same MSVC version and service pack due to 
SxS issues.


> 3. If not, how do I change the toolchain.

Not sure. Sorry. Perhaps if it detects an MSVC build of Qt installed the 
option will be enabled.


Ross. 




More information about the Qt-interest-old mailing list