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. Build fails as ui_mainwindow.h not found
Forum Updated to NodeBB v4.3 + New Features

Build fails as ui_mainwindow.h not found

Scheduled Pinned Locked Moved Solved General and Desktop
build failed
26 Posts 6 Posters 22.8k Views 2 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.
  • T Tanuja

    Hi all,

    I am new to QT and working on 5.6.

    • I am not able to buikd my code as ui_mainwindow.h not found error is coming.
      Please help
    artwawA Offline
    artwawA Offline
    artwaw
    wrote on last edited by
    #3

    @Tanuja Can you clean your build and run qmake?

    For more information please re-read.

    Kind Regards,
    Artur

    1 Reply Last reply
    0
    • jsulmJ jsulm

      @Tanuja Can you show your pro file?

      T Offline
      T Offline
      Tanuja
      wrote on last edited by
      #4

      @jsulm
      QT. += core GUI

      greater than(QT_MAJOR_VERSION, 4): QT += widgets

      TARGET = test
      TEMPLATE = app

      SOURCES += main.cpp
      main window.cpp

      HEADERS += main window.h

      FORMS += main window.ui

      artwawA 1 Reply Last reply
      0
      • T Tanuja

        @jsulm
        QT. += core GUI

        greater than(QT_MAJOR_VERSION, 4): QT += widgets

        TARGET = test
        TEMPLATE = app

        SOURCES += main.cpp
        main window.cpp

        HEADERS += main window.h

        FORMS += main window.ui

        artwawA Offline
        artwawA Offline
        artwaw
        wrote on last edited by
        #5

        @Tanuja said in Build fails as ui_mainwindow.h not found:

        main window.cpp
        HEADERS += main window.h
        FORMS += main window.ui

        Are those file names correct? You have spaces in them?

        For more information please re-read.

        Kind Regards,
        Artur

        T 1 Reply Last reply
        2
        • artwawA artwaw

          @Tanuja said in Build fails as ui_mainwindow.h not found:

          main window.cpp
          HEADERS += main window.h
          FORMS += main window.ui

          Are those file names correct? You have spaces in them?

          T Offline
          T Offline
          Tanuja
          wrote on last edited by
          #6

          @artwaw
          Yes it's correct
          There are no spaces in the file

          artwawA jsulmJ 2 Replies Last reply
          0
          • T Tanuja

            @artwaw
            Yes it's correct
            There are no spaces in the file

            artwawA Offline
            artwawA Offline
            artwaw
            wrote on last edited by
            #7

            @Tanuja In the .pro file your file names have spaces. Please make sure that they reflect real file names.

            For more information please re-read.

            Kind Regards,
            Artur

            1 Reply Last reply
            2
            • T Tanuja

              @artwaw
              Yes it's correct
              There are no spaces in the file

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #8

              @Tanuja

              QT. += core GUI
              

              should be

              QT += core gui
              

              And as @artwaw said: rerun qmake and rebuild.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              3
              • dheerendraD Offline
                dheerendraD Offline
                dheerendra
                Qt Champions 2022
                wrote on last edited by dheerendra
                #9

                Apart from previous posts, looks like you changed the UI file name.
                FORMS += main window.ui

                I'm seeing blank space between main and window.ui. Is it mainwindow.ui or window.ui ? If it is window.ui,it must be generating ui_window.h file. Please check that. So you must include the ui_windows.h instead of ui_mainwindow.h

                Dheerendra
                @Community Service
                Certified Qt Specialist
                http://www.pthinks.com

                T 1 Reply Last reply
                2
                • T Offline
                  T Offline
                  Tanuja
                  wrote on last edited by
                  #10

                  QT += core gui

                  greaterThan(QT_MAJOR_VERSION, 4) : QT += widgets

                  TARGET = test
                  TEMPLATE = app

                  SOURCES += main.cpp
                  mainwindow.cpp

                  HEADERS += mainwindow.h

                  FORMS += mainwindow.ui

                  This is my profile file

                  1 Reply Last reply
                  0
                  • dheerendraD dheerendra

                    Apart from previous posts, looks like you changed the UI file name.
                    FORMS += main window.ui

                    I'm seeing blank space between main and window.ui. Is it mainwindow.ui or window.ui ? If it is window.ui,it must be generating ui_window.h file. Please check that. So you must include the ui_windows.h instead of ui_mainwindow.h

                    T Offline
                    T Offline
                    Tanuja
                    wrote on last edited by
                    #11

                    @dheerendra
                    I have posted my pro file again.please have a look.

                    1 Reply Last reply
                    0
                    • dheerendraD Offline
                      dheerendraD Offline
                      dheerendra
                      Qt Champions 2022
                      wrote on last edited by
                      #12

                      This looks ok. Do you have the problem still ? Can you create a new project with all default settings in your QtCreator & check everything works ?

                      Dheerendra
                      @Community Service
                      Certified Qt Specialist
                      http://www.pthinks.com

                      T 1 Reply Last reply
                      1
                      • dheerendraD dheerendra

                        This looks ok. Do you have the problem still ? Can you create a new project with all default settings in your QtCreator & check everything works ?

                        T Offline
                        T Offline
                        Tanuja
                        wrote on last edited by
                        #13

                        @dheerendra
                        Yes I created a new project but the problem is still coming. Also there was Qt5cored.dll file which was missing. I added that also.
                        Is this problem because of that?

                        1 Reply Last reply
                        0
                        • dheerendraD Offline
                          dheerendraD Offline
                          dheerendra
                          Qt Champions 2022
                          wrote on last edited by
                          #14

                          Ok. I suspect that issue with your installation. One last check b4 u get into further. I'm assuiming that you are working on windows system. Do you see uic.exe executable in bin directory of your installation ?

                          Dheerendra
                          @Community Service
                          Certified Qt Specialist
                          http://www.pthinks.com

                          T 1 Reply Last reply
                          2
                          • dheerendraD dheerendra

                            Ok. I suspect that issue with your installation. One last check b4 u get into further. I'm assuiming that you are working on windows system. Do you see uic.exe executable in bin directory of your installation ?

                            T Offline
                            T Offline
                            Tanuja
                            wrote on last edited by
                            #15

                            @dheerendra
                            Yes it is there

                            jsulmJ 1 Reply Last reply
                            1
                            • T Tanuja

                              @dheerendra
                              Yes it is there

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #16

                              @Tanuja How did you install Qt?

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              T 1 Reply Last reply
                              1
                              • jsulmJ jsulm

                                @Tanuja How did you install Qt?

                                T Offline
                                T Offline
                                Tanuja
                                wrote on last edited by
                                #17

                                @jsulm
                                Downloaded the software and installed it.
                                It was working correctly when I installed it. After some time it started giving me this error.
                                As far as I know, there is some issue with my Qt5core.dll file

                                jsulmJ 1 Reply Last reply
                                0
                                • T Tanuja

                                  @jsulm
                                  Downloaded the software and installed it.
                                  It was working correctly when I installed it. After some time it started giving me this error.
                                  As far as I know, there is some issue with my Qt5core.dll file

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #18

                                  @Tanuja What is the issue with Qt5core.dll?
                                  You could try to install the latest Qt version (5.9.1).

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  T 1 Reply Last reply
                                  1
                                  • jsulmJ jsulm

                                    @Tanuja What is the issue with Qt5core.dll?
                                    You could try to install the latest Qt version (5.9.1).

                                    T Offline
                                    T Offline
                                    Tanuja
                                    wrote on last edited by
                                    #19

                                    @jsulm
                                    Ok will do that

                                    1 Reply Last reply
                                    1
                                    • dheerendraD Offline
                                      dheerendraD Offline
                                      dheerendra
                                      Qt Champions 2022
                                      wrote on last edited by
                                      #20

                                      as @jsulm already suggested, you better install the new version and try. My suspect is that you have installed some other software which has old Qt library in path. This must be causing the issue.

                                      Dheerendra
                                      @Community Service
                                      Certified Qt Specialist
                                      http://www.pthinks.com

                                      T 1 Reply Last reply
                                      2
                                      • dheerendraD dheerendra

                                        as @jsulm already suggested, you better install the new version and try. My suspect is that you have installed some other software which has old Qt library in path. This must be causing the issue.

                                        T Offline
                                        T Offline
                                        Tanuja
                                        wrote on last edited by
                                        #21

                                        @dheerendra
                                        I will try to install the new version and check.

                                        1 Reply Last reply
                                        0
                                        • T Offline
                                          T Offline
                                          Tanuja
                                          wrote on last edited by
                                          #22

                                          It's done
                                          I installed it again and now its building perfectly

                                          1 Reply Last reply
                                          1

                                          • Login

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