In my case this error was caused by extra symbols before QT += core gui widgets. So, the first step should be checking if that line compiles OK.