Missing mocinclude.tmp

447 Views Asked by At

I'm porting an Qt4.8.5, mingw 3.5 app to mingw 4.8.2, that is already correctly working on Linux gcc 4.8.2. What I'm getting is:

mingw32-make[]: ***No rule to make target 'moc-release/mocinclude.tmp' needed by 'moc-release/moc_main.cpp'

In MakeFile I see:

check: first

./moc-rel//mocinclude.tmp:
        @echo -IC:\Qt\4.8.6\include/QtCore> ./moc-rel//mocinclude.tmp
         @echo -IC:\Qt\4.8.6\include/QtNetwork>> ./moc-rel//mocinclude.tmp
         @echo -IC:\Qt\4.8.6\include/QtGui>> ./moc-rel//mocinclude.tmp
         @echo -IC:\Qt\4.8.6\include/QtXml>> ./moc-rel//mocinclude.tmp
         @echo -IC:\Qt\4.8.6\include>> ./moc-rel//mocinclude.tmp
         ...

When I create that file empty by hand the app compiles fine. I know that my include path is quite long, but it should be fine anyway, right? Am I missing something, or should I just add this file to git to have it in place?

Thanks

2

There are 2 best solutions below

2
On

In your makefile, you have this rule:

./moc-rel//mocinclude.tmp:
        @echo -IC:\Qt\4.8.6\include/QtCore> ./moc-rel//mocinclude.tmp
        ...

Notice that it will build the file ./moc-rel/mocinclude.tmp, which is not the same as ./moc-release/mocinclude.tmp. You appear to have a dependency, elsewhere in the makefile, on the latter, but only the rule to build the former. You need to resolve this discrepancy.

0
On

You can add # before MOC_DIR to commented it out.
Then compile will be done.