Include issue for ui.h since qt 5.15.12
-
Hi there,
since I updated to Qt 5.15.12 I get in any of my projects
a strange error message like this type:Member access into incomplete type 'Ui::MyApp' (fix available) myapp.h:76:7: forward declaration of 'Ui::MyApp' Include "build/release/tmp/ui_myApp.h" for symbol Ui::MyAppI thought Qt Creator and Qt takes care of including ui_*.h files.
Does anybody has an idea how to fix this?thx in advance
-
Hi there,
since I updated to Qt 5.15.12 I get in any of my projects
a strange error message like this type:Member access into incomplete type 'Ui::MyApp' (fix available) myapp.h:76:7: forward declaration of 'Ui::MyApp' Include "build/release/tmp/ui_myApp.h" for symbol Ui::MyAppI thought Qt Creator and Qt takes care of including ui_*.h files.
Does anybody has an idea how to fix this?thx in advance
@lacuna
Make sure you have cleaned and rebuilt to create theui_myApp.hfile whenuicis run onmyApp.uifile.
YourmyApp.cppshould have#include "ui_myApp.hin it.Include "build/release/tmp/ui_myApp.h" for symbol Ui::MyAppThe file should be generated into, and found in,
build/release/ui_myApp.h. I don't know how/why you have atmpsubdirectory in there, and it looks like that is the problem. -
@lacuna
Make sure you have cleaned and rebuilt to create theui_myApp.hfile whenuicis run onmyApp.uifile.
YourmyApp.cppshould have#include "ui_myApp.hin it.Include "build/release/tmp/ui_myApp.h" for symbol Ui::MyAppThe file should be generated into, and found in,
build/release/ui_myApp.h. I don't know how/why you have atmpsubdirectory in there, and it looks like that is the problem.Dear Jon, thx for your valuable response. Let me answer your question about the tmp directory.
We use a different structure for build directories, instead of shadow build structure.
With "tmp" and build it worked fine the last 3 years and was easier to be cleared and maintained.CONFIG(debug, debug|release) { DESTDIR = $$PWD/build/debug/ } else { DESTDIR = $$PWD/build/release/ } ... some more stuff #Temporary build directory TMP_DIR = $$DESTDIR/tmp OBJECTS_DIR = $$DESTDIR/tmp MOC_DIR = $$DESTDIR/tmp RCC_DIR = $$DESTDIR/tmp UI_DIR = $$DESTDIR/tmp `` -
Hi,
Rather than hard coding paths within your sources, you should do out of source builds. This will make things even easier to clean.
-
Hi,
Rather than hard coding paths within your sources, you should do out of source builds. This will make things even easier to clean.
-
@lacuna
I suggest you find which directory theui_...hfile is being regenerated into when theuiccommand is run. Then look at how your code is doing the include and what the include path is. Then work back from there to what is/is not going on, and compare to previous version.