[Development] Help with build failure on Windows

Thiago Macieira thiago.macieira at intel.com
Tue Aug 6 07:40:07 CEST 2013

On segunda-feira, 5 de agosto de 2013 22:18:43, Chris Meyer wrote:
> I'm understanding more... but there is still something I don't understand.
> Don't the moc_*.cpp files get compiled directly too? How does qmake know
> not to generate Makefile instructions to directly compile the moc_*.cpp
> files that use Q_PRIVATE_SLOT? If it were to compile them directly, it
> would be missing the private headers, which was the error I was seeing.

qmake scans all source files to see what they #include. If a A.cpp has #include 
"B.cpp", then B.cpp is removed from the list of files to compile.

So this is what happens:
 - qmake scans all files in HEADERS for Q_OBJECT
 - those files get moc'ed and the resulting file is added to SOURCES
 - then qmake scans SOURCES again and finds the #include
 - the moc_*.cpp file in question is removed from SOURCES

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130805/3cc5f8f9/attachment.sig>

More information about the Development mailing list