June 29, 2011

Jaeger Bomb Jaeger Bomb
Lab Rat
1 posts

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.

Thanks!

1 reply

June 29, 2011

Tobias Hunger Tobias Hunger
Area 51 Engineer
3383 posts

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.

 
  ‹‹ Additional make target (for code coverage using gcc/gcov)      [solved]In Qt Creator, how to set project property for both MinGW and VC compiler? ››

You must log in to post a reply. Not a member yet? Register here!