Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt building sequence (rcc -> uic -> moc -> preprocessor -> normal compiler)?

Please I wanna know the order in which these building tools are called in QT prjects :
The UIC - The MOC - The RCC - The preprocessor - The normal c++ compiler (e.g Gcc)

like image 468
Mekacher Anis Avatar asked Jul 26 '26 08:07

Mekacher Anis


1 Answers

First step :

UIC process the *.ui files and produce *.h outputs MOC process the .h files (those with Q_OBJECT macro) and produce moc_.cpp files RCC process the *.rc files and produce *.cpp files

Second step :

All your writed .h/.cpp files and all the generated .h/.cpp files are processed as "normal" source code by your "normal" compiler.

For a complete answer, you should know that qMake create dependencies between these files. For example if "foo.h" file contain the "Q_OBJECT" macro, MOC will produce "moc_foo.cpp" file. But qMake will add a dependency : "moc_foo.cpp" will be marked as dependent on "foo.h". So, if you modify "foo.h" file, your compiler knows that MOC should be re-run on this file to produce the new version of "moc_foo.cpp"

like image 96
Aurelien Avatar answered Jul 27 '26 21:07

Aurelien