Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I need to remove build directory after changing something in a Qt .pro file?

Every single time I change something in a Qt .pro file (add a new source file, change compile flags, etc...), my changes do not take effect. I am using Qt Creator. The same thing happens on windows (MSVC compiler) and Mac. If i remove build directory, it's ok then. (not counting wasted time for full rebuild)

Could be a bug but as it sounds so trivial it rather feels like I am missing something.

Thanks!

like image 258
Zsolt Szatmari Avatar asked Mar 16 '23 08:03

Zsolt Szatmari


1 Answers

When you change somethng in a *.pro file, you have to re-run qmake on the project, to refresh the files in Qt Creator. You don't need to delete your build folder every time.

But when you delete the build folder, Qt automatically run qmake on the project before running the compilation. Your solution works, but it's a bit overkill ;)

qtcreator build menu

This menu is also available when right-clicking on the project

like image 176
Antwane Avatar answered Apr 25 '23 10:04

Antwane