Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[SOLVED] How can I rebuild the project once I press F5 to start debugging?



  • Hello,

    How can I automatically rebuild the project once I press F5 to start debugging?

    Thank you.


  • Moderators

    I guess you are talking about Qt Creator here?



  • Do you want a complete rebuild or just a build that compiles the files that changed from the last build only?



  • Right, I use Qt Creator for C++, non-qt project.

    Ideally it should invoke build only if I change any source files. I use my own make files that compile and build only files that have been changed. I should have been more specific from the start.



  • This should work by default. Maybe you need to tweak some of the settings in global settings / Build an Run Settings


  • Moderators

    That should work.

    There are two options in Tools->Options->Build & Run->General that are relevant here:
    Make sure both "Always build before deploy" and "Always deploy before run" are checked.



  • “Always deploy before run” did it - thank you!

    I do not have Tools->Options->Build & Run though (Qt Creatro 2.3.1) , it is in Tools->Options->Projects.

    I do not even know what they mean by deploy, help system is absent after the install. I think I cleared this option because I am not "deploying" my projects.


  • Moderators

    Qt Creator Builds, deploys and only afterwards runs your app.

    "Build" is basically "turning source code into executables"

    "Deploy" is basically "getting everything into the right place to run stuff". That is a no-op for most desktop projects (though some do require a "make install" there), but is rather important when cross-compiling for embedded devices.

    PS: Yes, those settings moved around a bit recently in an effort to make that dialog fit onto a typical netbook screen.



  • I see, thank you for explanation Tobias.


Log in to reply