Important: Please read the Qt Code of Conduct -

Having to rebuild after switching build configurations.

  • Hi all,

    I have been using Qt Creator for some time now, and it has been doing a great job of allowing me to make all kinds of cool applications. I do have one question, however. If I build a project in release mode, and then switch to debug and simply build again, it doesn't seem to recompile the project. I managed to prove this by having a project that in release mode would build a library file named 'xxx' and for debug it would be called 'xxx_d'. I switched to release, and it compiled fine. I then switched to debug, and hit "build project", and sure enough, the xxx_d file was created. However, it was exactly the same as the xxx file (file sizes were identical, no debugging info). It was not until I hit "rebuild project", under debug, that the debugging information was including and the library was then much larger. Is there an option that I can select to ensure that the projects will be rebuilt after switching cofigurations? The workaround is fine, but I thought maybe I was missing something.


  • Moderators

    That is true: If you build in source then you need to make sure that the files are all gone when rebuilding. It is not trivial to decide for the IDE when you need to clean files and when not (in general you do not want that since it increases build times a lot when you clean all the object files), so Creator does not try.

    For this reason we encourage the use of shadow build directories whenever possible: Those allow to keep the different build configurations separate from each other. That is the only way we see to really make working with different build configurations safe.

Log in to reply