Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Installation problem
Qt 6.11 is out! See what's new in the release blog

Installation problem

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
8 Posts 2 Posters 764 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.
  • J Offline
    J Offline
    JohnnyB
    wrote on last edited by
    #1

    Hello I'm new to Qt . I just intall Q6. When I'm trying to start a new qt widget project I'm getting errors in mainwindow.cpp
    1-( for "ui(new Ui::MainWindow)... " allocation of incomplete type 'UI::MainWindow'"
    2-( For ui->setupUi(this)) ..."Member access into incomplete type 'UI::MainWindow'"
    3- ("delete ui") delete pointer to incomplete type 'Ui::MainWindow' may cause undefined behavior
    Can someone help ?
    Thanks

    JonBJ 1 Reply Last reply
    0
    • J JohnnyB

      Hello I'm new to Qt . I just intall Q6. When I'm trying to start a new qt widget project I'm getting errors in mainwindow.cpp
      1-( for "ui(new Ui::MainWindow)... " allocation of incomplete type 'UI::MainWindow'"
      2-( For ui->setupUi(this)) ..."Member access into incomplete type 'UI::MainWindow'"
      3- ("delete ui") delete pointer to incomplete type 'Ui::MainWindow' may cause undefined behavior
      Can someone help ?
      Thanks

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

      @JohnnyB
      Is this line in your mainwindow.cpp file:

      #include "ui_mainwindow.h"
      
      1 Reply Last reply
      0
      • J Offline
        J Offline
        JohnnyB
        wrote on last edited by
        #3

        wow you are quick !
        yes "mainwindow.cpp"

        JonBJ 1 Reply Last reply
        0
        • J JohnnyB

          wow you are quick !
          yes "mainwindow.cpp"

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

          @JohnnyB said in Installation problem:

          yes "mainwindow.cpp"

          Sorry I don't know what that means.

          Either that include line is absent, or the ui_mainwindow.h is empty/needs regenerating from a complete rebuild.

          1 Reply Last reply
          0
          • J Offline
            J Offline
            JohnnyB
            wrote on last edited by
            #5

            There is already: #include "./ui_mainwindow" but I get the error that this file doesn't exist which is true, I checked in the directory
            and the line you told me to add produce the same error . This file is simply not created by Qt and doesn't exist ???

            JonBJ 1 Reply Last reply
            0
            • J JohnnyB

              There is already: #include "./ui_mainwindow" but I get the error that this file doesn't exist which is true, I checked in the directory
              and the line you told me to add produce the same error . This file is simply not created by Qt and doesn't exist ???

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

              @JohnnyB
              It is a file generated from your design file, mainwindow.ui, or whatever. Whenever you save that from Designer the build process should regenerate the ui_mainwindow.h file.

              1 Reply Last reply
              0
              • J Offline
                J Offline
                JohnnyB
                wrote on last edited by
                #7

                Sorry @JonB , it seems that there is a delay between what I type and what appear. So To answer your first question you ask me :

                1- Is this line in your mainwindow.cpp. The answer is yes
                2- you said : Either that include line is absent, or the ui_mainwindow.h is empty/needs regenerating from a complete rebuild.I answered: a) There is already the line "./ui_mainwindow" b) I added the line "ui_mainwindow.h" but the problem is that no such file exist
                Thanks for your help

                J 1 Reply Last reply
                0
                • J JohnnyB

                  Sorry @JonB , it seems that there is a delay between what I type and what appear. So To answer your first question you ask me :

                  1- Is this line in your mainwindow.cpp. The answer is yes
                  2- you said : Either that include line is absent, or the ui_mainwindow.h is empty/needs regenerating from a complete rebuild.I answered: a) There is already the line "./ui_mainwindow" b) I added the line "ui_mainwindow.h" but the problem is that no such file exist
                  Thanks for your help

                  J Offline
                  J Offline
                  JohnnyB
                  wrote on last edited by
                  #8

                  @JohB Hello. I found the problem . Qt doens't generate the ui_mainwindow.h before there is a control added to the form . Thanks for your time

                  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