Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. './ui_mywidget.h' file not found
Forum Updated to NodeBB v4.3 + New Features

'./ui_mywidget.h' file not found

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
9 Posts 2 Posters 919 Views
  • 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.
  • C Offline
    C Offline
    chunxu
    wrote on last edited by
    #1

    I justed create a project by default with qt 6.4.2 and qt creator 9.0.1

    here's my steps:

    new project-> Application(qt)--> Qt Widgets Application-->

    F:\qt\myWidget\mywidget.cpp:2: error: './ui_mywidget.h' file not found

    JonBJ 1 Reply Last reply
    0
    • C chunxu

      I justed create a project by default with qt 6.4.2 and qt creator 9.0.1

      here's my steps:

      new project-> Application(qt)--> Qt Widgets Application-->

      F:\qt\myWidget\mywidget.cpp:2: error: './ui_mywidget.h' file not found

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @chunxu
      ui_mywidget.h is a file generated by running uic on a .ui (Desisgner) file. It won't be created until the first time you run a Build. It will be placed not where your source files are but rather in the build output directory. I am not sure whether there is any significance to the error message have ./ in the reported ./ui_mywidget.h' file not found.

      C 1 Reply Last reply
      2
      • JonBJ JonB

        @chunxu
        ui_mywidget.h is a file generated by running uic on a .ui (Desisgner) file. It won't be created until the first time you run a Build. It will be placed not where your source files are but rather in the build output directory. I am not sure whether there is any significance to the error message have ./ in the reported ./ui_mywidget.h' file not found.

        C Offline
        C Offline
        chunxu
        wrote on last edited by
        #3

        @JonB thank you, I knew it's generated by uic & after the first build after searched from google.

        What confused me is that after i built the proejct, and the window showed OK, the error still there.

        JonBJ 1 Reply Last reply
        0
        • C chunxu

          @JonB thank you, I knew it's generated by uic & after the first build after searched from google.

          What confused me is that after i built the proejct, and the window showed OK, the error still there.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @chunxu
          Did you start by verifying that it is indeed generated and placed into the build output directory? Either

          • It's not there; or
          • That directory is (somehow) not being used to include ./ui_mywidget.h.
          C 1 Reply Last reply
          0
          • JonBJ JonB

            @chunxu
            Did you start by verifying that it is indeed generated and placed into the build output directory? Either

            • It's not there; or
            • That directory is (somehow) not being used to include ./ui_mywidget.h.
            C Offline
            C Offline
            chunxu
            wrote on last edited by
            #5

            @JonB The header file is placed in folder below by the QT creator.

            F:\qt\build-myWidget-Desktop_Qt_6_4_2_MinGW_64_bit-Debug\myWidget_autogen\include
            
            JonBJ 1 Reply Last reply
            0
            • C chunxu

              @JonB The header file is placed in folder below by the QT creator.

              F:\qt\build-myWidget-Desktop_Qt_6_4_2_MinGW_64_bit-Debug\myWidget_autogen\include
              
              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @chunxu
              That is not a directory I am familiar with, it would not have gone there with Qt5, I don't know if that has changed and you are maybe using Qt6. Make sure that directory is on the list of directories search for include files in your project when the compile command is executed.

              C 1 Reply Last reply
              0
              • C Offline
                C Offline
                chunxu
                wrote on last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                0
                • JonBJ JonB

                  @chunxu
                  That is not a directory I am familiar with, it would not have gone there with Qt5, I don't know if that has changed and you are maybe using Qt6. Make sure that directory is on the list of directories search for include files in your project when the compile command is executed.

                  C Offline
                  C Offline
                  chunxu
                  wrote on last edited by
                  #8

                  @JonB
                  Anyway, thanks for your help!
                  Seems the product was not well tested.
                  It works OK when I chose qmake as the build tool.

                  JonBJ 1 Reply Last reply
                  0
                  • C chunxu

                    @JonB
                    Anyway, thanks for your help!
                    Seems the product was not well tested.
                    It works OK when I chose qmake as the build tool.

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #9

                    @chunxu
                    Yes, cmake (default at Qt6) is quite different from qmake (default at Qt5), your project would need to be reconfigured if changing between the two.

                    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