What might be causing the errors reported here?
-
I was making some adjustments, in another subproject, when I suddenly noticed that the subproject that involves UI development started to crash without me even messing with anything in it.
I created a new project from scratch to check if there was any relationship with my project settings, and even the new project also has the same error:
teste.h:12:5: error: incomplete result type 'QString' in function definition qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT' qobjectdefs.h:140:27: note: expanded from macro 'QT_TR_FUNCTIONS' qglobal.h:768:7: note: forward declaration of 'QString' teste.h:12:5: error: calling 'tr' with incomplete return type 'QString' qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT' qobjectdefs.h:141:35: note: expanded from macro 'QT_TR_FUNCTIONS' qobjectdefs.h:348:13: note: 'tr' declared here qglobal.h:768:7: note: forward declaration of 'QString' teste.h:12:5: error: incomplete result type 'QString' in function definition qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT' qobjectdefs.h:142:41: note: expanded from macro 'QT_TR_FUNCTIONS' qglobal.h:768:7: note: forward declaration of 'QString' teste.h:12:5: error: incomplete result type 'QString' in function definition qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT' qobjectdefs.h:142:41: note: expanded from macro 'QT_TR_FUNCTIONS' qglobal.h:768:7: note: forward declaration of 'QString' teste.h:12:5: error: calling 'tr' with incomplete return type 'QString' qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT' qobjectdefs.h:143:35: note: expanded from macro 'QT_TR_FUNCTIONS' qobjectdefs.h:348:13: note: 'tr' declared here qglobal.h:768:7: note: forward declaration of 'QString'How to fix such problem?
-
I was making some adjustments, in another subproject, when I suddenly noticed that the subproject that involves UI development started to crash without me even messing with anything in it.
I created a new project from scratch to check if there was any relationship with my project settings, and even the new project also has the same error:
teste.h:12:5: error: incomplete result type 'QString' in function definition qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT' qobjectdefs.h:140:27: note: expanded from macro 'QT_TR_FUNCTIONS' qglobal.h:768:7: note: forward declaration of 'QString' teste.h:12:5: error: calling 'tr' with incomplete return type 'QString' qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT' qobjectdefs.h:141:35: note: expanded from macro 'QT_TR_FUNCTIONS' qobjectdefs.h:348:13: note: 'tr' declared here qglobal.h:768:7: note: forward declaration of 'QString' teste.h:12:5: error: incomplete result type 'QString' in function definition qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT' qobjectdefs.h:142:41: note: expanded from macro 'QT_TR_FUNCTIONS' qglobal.h:768:7: note: forward declaration of 'QString' teste.h:12:5: error: incomplete result type 'QString' in function definition qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT' qobjectdefs.h:142:41: note: expanded from macro 'QT_TR_FUNCTIONS' qglobal.h:768:7: note: forward declaration of 'QString' teste.h:12:5: error: calling 'tr' with incomplete return type 'QString' qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT' qobjectdefs.h:143:35: note: expanded from macro 'QT_TR_FUNCTIONS' qobjectdefs.h:348:13: note: 'tr' declared here qglobal.h:768:7: note: forward declaration of 'QString'How to fix such problem?
@Carlos-Delfino said in What might be causing the errors reported here?:
teste.h:12:5: error: incomplete result type 'QString' in function definitionShow at least up to line #12 of
teste.hwhere this error comes from. We should see what lines precede it. I believeteste.his your own file, not Qt's? We also need to see where you includeteste.hinto your.cpp/.hfile, again to see the lines which precede it. Looks like you have included<QString>where it's needed.