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. I just installed QtCreator in Windows, created a project and get many errors default code.
Forum Updated to NodeBB v4.3 + New Features

I just installed QtCreator in Windows, created a project and get many errors default code.

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
11 Posts 3 Posters 772 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 Jed208

    Hi!
    The version i installed is QtCreator 6.3.1
    The errors are in the attached images
    Captura de pantalla (292).png
    Captura de pantalla (293).png
    Captura de pantalla (294).png
    Why is this happening?

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

    @Jed208 said in I just installed QtCreator in Windows, created a project and get many errors default code.:

    The version i installed is QtCreator 6.3.1

    The version of Qt Creator is not the issue. Your code cannot resolved #include <QMainWindow>. So have you installed Qt correctly?

    Christian EhrlicherC J 2 Replies Last reply
    1
    • JonBJ JonB

      @Jed208 said in I just installed QtCreator in Windows, created a project and get many errors default code.:

      The version i installed is QtCreator 6.3.1

      The version of Qt Creator is not the issue. Your code cannot resolved #include <QMainWindow>. So have you installed Qt correctly?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #3

      @JonB said in I just installed QtCreator in Windows, created a project and get many errors default code.:

      So have you installed Qt correctly?

      And do you add QT += widgets in your pro-file so you can use the QtWidgets library?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      J 1 Reply Last reply
      3
      • JonBJ JonB

        @Jed208 said in I just installed QtCreator in Windows, created a project and get many errors default code.:

        The version i installed is QtCreator 6.3.1

        The version of Qt Creator is not the issue. Your code cannot resolved #include <QMainWindow>. So have you installed Qt correctly?

        J Offline
        J Offline
        Jed208
        wrote on last edited by Jed208
        #4

        @JonB I just installed it normally, and the installer didn't give me any errors

        EDIT: i just remember, in the installation i choose the 6.4.2, but in the window that displays the option "About Qt Creator" it appears that i have 6.3.1, but the only kit available to use is Desktop Qt 6.2.4 MinGW 64-bit

        I don't know if that is the cause of the error.

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @JonB said in I just installed QtCreator in Windows, created a project and get many errors default code.:

          So have you installed Qt correctly?

          And do you add QT += widgets in your pro-file so you can use the QtWidgets library?

          J Offline
          J Offline
          Jed208
          wrote on last edited by
          #5

          @Christian-Ehrlicher Here are the pro-filesCaptura de pantalla (295).png
          Captura de pantalla (296).png

          Im so noob in qtcreator, so i don't know is something is missing

          Christian EhrlicherC 1 Reply Last reply
          0
          • J Jed208

            @Christian-Ehrlicher Here are the pro-filesCaptura de pantalla (295).png
            Captura de pantalla (296).png

            Im so noob in qtcreator, so i don't know is something is missing

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #6

            @Jed208 said in I just installed QtCreator in Windows, created a project and get many errors default code.:

            so i don't know is something is missing

            And do you add QT += widgets in your pro-file so you can use the QtWidgets library?

            I already told you what to do.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            J 1 Reply Last reply
            1
            • Christian EhrlicherC Christian Ehrlicher

              @Jed208 said in I just installed QtCreator in Windows, created a project and get many errors default code.:

              so i don't know is something is missing

              And do you add QT += widgets in your pro-file so you can use the QtWidgets library?

              I already told you what to do.

              J Offline
              J Offline
              Jed208
              wrote on last edited by
              #7

              @Christian-Ehrlicher Oh sorry
              I already added that but the error continues

              Christian EhrlicherC 1 Reply Last reply
              0
              • J Jed208

                @Christian-Ehrlicher Oh sorry
                I already added that but the error continues

                Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #8

                @Jed208 said in I just installed QtCreator in Windows, created a project and get many errors default code.:

                I already added that but the error continues

                I doubt it. And your screenshots (whyever we need screenshots for textfiles) does not show this.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                1
                • J Offline
                  J Offline
                  Jed208
                  wrote on last edited by
                  #9

                  I added it as follows:
                  "untitled.pro"

                  TEMPLATE = subdirs
                  QT += widgets
                  
                  SUBDIRS += \
                      ui
                  
                  

                  "ui.pro"

                  QT       += core gui
                  QT += widgets
                  
                  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                  
                  CONFIG += c++17
                  
                  # You can make your code fail to compile if it uses deprecated APIs.
                  # In order to do so, uncomment the following line.
                  #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                  
                  SOURCES += \
                      main.cpp \
                      mainwindow.cpp
                  
                  HEADERS += \
                      mainwindow.h
                  
                  FORMS += \
                      mainwindow.ui
                  
                  # Default rules for deployment.
                  qnx: target.path = /tmp/$${TARGET}/bin
                  else: unix:!android: target.path = /opt/$${TARGET}/bin
                  !isEmpty(target.path): INSTALLS += target
                  

                  And in the header file it still appears 'QMainWindow' File not found

                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    You have to re-run qmake after thsi it's also useless to add it to your untitled.pro with the subdirs template.

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    J 1 Reply Last reply
                    1
                    • Christian EhrlicherC Christian Ehrlicher

                      You have to re-run qmake after thsi it's also useless to add it to your untitled.pro with the subdirs template.

                      J Offline
                      J Offline
                      Jed208
                      wrote on last edited by
                      #11

                      Thanks @Christian-Ehrlicher
                      I solved the problem by adding the project folder to the directory where I installed qt, it's not the most comfortable but it's what worked for me

                      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