Cannot open include file: ui_*.h when using multiple Qt projects in the same Visual Studios solution
-
I'm trying to use a header file from one Qt project that includes the associated ui_myDialog.h file in a different Qt project in the same solution. The project that has this header file creates the ui_myDialog.h file successfully and builds fine, but when I try to use this header file in the other project, it is unable to build and gives me fatal error C1083: Cannot open include file: 'ui_myDialog.h': No such file or directory. Any help or insights with this issue would be much appreciated. Thank you.
-
Since the file is generated it's not in the source but in the build dir. So either include this directory or better forward declare the Ui::Dialog class und use a pointer to it (Ui::Dialog *m_ui) so you don't need to include the generated ui header file in your header at all.
-
Thank you very much for your help. I included the build directory and set the project dependencies accordingly. This fixed the issue.
-
My second solution would be much more portable.