Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. ui_device.h not found intermitent failure
Qt 6.11 is out! See what's new in the release blog

ui_device.h not found intermitent failure

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 804 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    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.

    a59b73db-9095-44c4-a753-36d38fe1319c-image.png

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      ui_device.h is generated from device.ui when uic is run against it. In a qmake project this happens because device.ui is listed in the FORMS variable.

      A 1 Reply Last reply
      1
      • C ChrisW67

        ui_device.h is generated from device.ui when uic is run against it. In a qmake project this happens because device.ui is listed in the FORMS variable.

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        @ChrisW67 So to fix this I have to go thru all .pro files and find incorrect device.ui ?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          First step:

          You have to go through the PRO file you are claiming intermittent behaviour from and make sure it lists device.ui in FORMS if it should be. If there is no device.ui that is part of your project then it should not be present in the FORMS variable and no CPP file should include ui_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-Release
          

          Sharing build directories between different sources, Qt versions, and debug/release selection is a recipe for failure.

          A 1 Reply Last reply
          0
          • C ChrisW67

            First step:

            You have to go through the PRO file you are claiming intermittent behaviour from and make sure it lists device.ui in FORMS if it should be. If there is no device.ui that is part of your project then it should not be present in the FORMS variable and no CPP file should include ui_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-Release
            

            Sharing build directories between different sources, Qt versions, and debug/release selection is a recipe for failure.

            A Offline
            A Offline
            Anonymous_Banned275
            wrote on last edited by
            #5

            @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...

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved