Qt compiler warning: overriding commands for target / ignoring old commands for target

sashoalm picture sashoalm · Jan 18, 2011 · Viewed 28.3k times · Source

When I'm compiling my Qt project for Windows I receive these 2 warnings:

Makefile.Debug:109: warning: overriding commands for target `debug/moc_mainwindow.cpp'
Makefile.Debug:106: warning: ignoring old commands for target `debug/moc_mainwindow.cpp'

I assume they indicate some problem with my project config, what is the problem and how do I fix it?

Answer

Kadir Erdem Demir picture Kadir Erdem Demir · Jan 10, 2013

I got the same error once , maybe source of your problem is different but I will write anyways. In my *.pro file, it was like :

SOURCES += main.cpp\
    mainwindow.cpp\
    serialHelper.cpp \
serialHelper.cpp

HEADERS  += mainwindow.h\
     += serialHelper.h \
serialHelper.h \
typeDefinitions.h

cpp and header file was repeating itself. I delete the repeating includes and problem solved for me .