ui_device.h not found intermitent failure
-
For past few months I have been living with this INTERMITTENT "failure".
(Ask Mrs Google for definition of "intermittent" )It takes one or two "build" before I can "run".
I have original .pro file and my modified copy of it.
The original NEVER fails to build... , but I am not using it in my project anyway.
My copy is apparently wrong, however, it is an intermittent failure and I have no clue what could be wrong
when it does not fails consistenty.My copy has been extensively modified so I just cannot start over from scratch.

-
ui_device.his generated fromdevice.uiwhenuicis run against it. In a qmake project this happens becausedevice.uiis listed in theFORMSvariable.@ChrisW67 So to fix this I have to go thru all .pro files and find incorrect device.ui ?
-
First step:
You have to go through the PRO file you are claiming intermittent behaviour from and make sure it lists
device.uiinFORMSif it should be. If there is nodevice.uithat is part of your project then it should not be present in theFORMSvariable and no CPP file should includeui_device.h.Since you have a original PRO that is not broken, you can use that as a reference.
Second step:
Ensure that you have a unique build directory for the project for each Qt version, debug/release selection, and set of sources. So, for one set of source code in
/tmp/untitled, and two Qt versions, I have these build directories:/tmp/build-untitled-Desktop_Qt_5_15_2_GCC_64bit-Debug /tmp/build-untitled-Desktop_Qt_5_15_2_GCC_64bit-Release /tmp/build-untitled-Desktop_Qt_6_4_0_GCC_64bit-Debug /tmp/build-untitled-Desktop_Qt_6_4_0_GCC_64bit-ReleaseSharing build directories between different sources, Qt versions, and debug/release selection is a recipe for failure.
-
First step:
You have to go through the PRO file you are claiming intermittent behaviour from and make sure it lists
device.uiinFORMSif it should be. If there is nodevice.uithat is part of your project then it should not be present in theFORMSvariable and no CPP file should includeui_device.h.Since you have a original PRO that is not broken, you can use that as a reference.
Second step:
Ensure that you have a unique build directory for the project for each Qt version, debug/release selection, and set of sources. So, for one set of source code in
/tmp/untitled, and two Qt versions, I have these build directories:/tmp/build-untitled-Desktop_Qt_5_15_2_GCC_64bit-Debug /tmp/build-untitled-Desktop_Qt_5_15_2_GCC_64bit-Release /tmp/build-untitled-Desktop_Qt_6_4_0_GCC_64bit-Debug /tmp/build-untitled-Desktop_Qt_6_4_0_GCC_64bit-ReleaseSharing build directories between different sources, Qt versions, and debug/release selection is a recipe for failure.
@ChrisW67 went thru all .pro files and I have only one ui_device.h in correct form.
I make sure the project has "shadow build" disabled. That being enabled has been a source of problems when I switch folders and do not check it.At "configuration" I have selected "current directory" and I am not sure what it does - however when i start a new version of the project it is often changed to different other directory and the entry is in red.
This is all fine , but still getting this error, , now in triplicate and "build" and another "build " and "run" USUALLY
works.Very frustrating...