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. Qt Creator not compiling on Windows 10
Forum Updated to NodeBB v4.3 + New Features

Qt Creator not compiling on Windows 10

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
15 Posts 5 Posters 1.3k 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.
  • AxelViennaA Offline
    AxelViennaA Offline
    AxelVienna
    wrote on last edited by
    #5

    You are right, Christian.
    Here is Windows:

    W:\>cd WhiteDolphin\WhiteDolphinV2\WhiteDolphin\WhiteGUI
    
    W:\WhiteDolphin\WhiteDolphinV2\WhiteDolphin\WhiteGUI>dir ..\WhiteEngine\whiteapi.cpp
     Datenträger in Laufwerk W: ist userhomes
     Volumeseriennummer: E7CE-5580
    
     Verzeichnis von W:\WhiteDolphin\WhiteDolphinV2\WhiteDolphin\WhiteEngine
    
    17.07.2021  07:26            16.140 whiteapi.cpp
                   1 Datei(en),         16.140 Bytes
                   0 Verzeichnis(se), 11.005.326.700.544 Bytes frei
    
    W:\WhiteDolphin\WhiteDolphinV2\WhiteDolphin\WhiteGUI>
    

    C++ and Python walk into a bar. C++ reuses the first glass.

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

      And from where do you call make? Since your build dir is not your source dir I would guess it's wrong.
      Use absolute paths, use your code into the current dir or create a separate library with a separate pro file but don't use relative paths for sources.

      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
      0
      • AxelViennaA Offline
        AxelViennaA Offline
        AxelVienna
        wrote on last edited by
        #7

        Thanks Christian - good idea, done.
        I have just copied the entire tree into a new directory and put all external sources (the ones with relative paths) into the project directory. I have removed the SOURCES and HEADERS section from the .pro file and added every file manually through the "add existing file" function.
        The SOUCRES section reads as follows (HEADER section is identical except for .h instead of .cpp).

        SOURCES += \
            whiteapi.cpp \
            whitedata.cpp \
            whitefile.cpp \
            whitejson.cpp \
            whitelog.cpp \
            whiterequest.cpp \
            whitestatus.cpp \
            whitetimer.cpp \
            whitetools.cpp \
            whitetranslator.cpp \
            apikey.cpp \
            apiwizard.cpp \
            detailam.cpp \
            detailar.cpp \
            detailrender.cpp \
            importfile.cpp \
            main.cpp \
            models.cpp \
            notyfier.cpp \
            whitebar.cpp \
            whiteclient.cpp \
            whiteconfig.cpp \
            whitegui.cpp \
            whitelogin.cpp \
            whitetimerpopup.cpp \
            whiteview.cpp
        

        Error message stays the same, save for absolute paths being used now.

        g++: error: WINDOWS -IC:/Users/User/Documents/WhiteGUI -I. -I../../../Win64/include -I../WhiteEngine -I../WhiteEngine -I../WhiteEngine -I../WhiteEngine -IC:/Qt/6.1.2/mingw81_64/include -IC:/Qt/6.1.2/mingw81_64/include/QtQuickControls2 -IC:/Qt/6.1.2/mingw81_64/include/QtQuick -IC:/Qt/6.1.2/mingw81_64/include/QtOpenGL -IC:/Qt/6.1.2/mingw81_64/include/QtWidgets -IC:/Qt/6.1.2/mingw81_64/include/QtGui -IC:/Qt/6.1.2/mingw81_64/include/QtQmlModels -IC:/Qt/6.1.2/mingw81_64/include/QtQml -IC:/Qt/6.1.2/mingw81_64/include/QtNetwork -IC:/Qt/6.1.2/mingw81_64/include/QtCore -Idebug -I. -IC:/VulkanSDK/1.0.51.0/Include -IC:/Qt/6.1.2/mingw81_64/mkspecs/win32-g++  -o debug\whiteapi.o C:\Users\User\Documents\WhiteGUI\whiteapi.cpp: No such file or directory
        g++: fatal error: no input files
        compilation terminated.
        

        The message clearly seems misleading as the file claimed to be missing is actually existing:

        C:\Users\User\Documents\WhiteGUI>dir whiteapi.cpp
         Datenträger in Laufwerk C: ist Windows
         Volumeseriennummer: B2A1-AA19
        
         Verzeichnis von C:\Users\User\Documents\WhiteGUI
        
        17.07.2021  07:26            16.140 whiteapi.cpp
                       1 Datei(en),         16.140 Bytes
                       0 Verzeichnis(se), 160.223.092.736 Bytes frei
        
        C:\Users\User\Documents\WhiteGUI>
        

        C++ and Python walk into a bar. C++ reuses the first glass.

        JonBJ 1 Reply Last reply
        0
        • AxelViennaA AxelVienna

          Thanks Christian - good idea, done.
          I have just copied the entire tree into a new directory and put all external sources (the ones with relative paths) into the project directory. I have removed the SOURCES and HEADERS section from the .pro file and added every file manually through the "add existing file" function.
          The SOUCRES section reads as follows (HEADER section is identical except for .h instead of .cpp).

          SOURCES += \
              whiteapi.cpp \
              whitedata.cpp \
              whitefile.cpp \
              whitejson.cpp \
              whitelog.cpp \
              whiterequest.cpp \
              whitestatus.cpp \
              whitetimer.cpp \
              whitetools.cpp \
              whitetranslator.cpp \
              apikey.cpp \
              apiwizard.cpp \
              detailam.cpp \
              detailar.cpp \
              detailrender.cpp \
              importfile.cpp \
              main.cpp \
              models.cpp \
              notyfier.cpp \
              whitebar.cpp \
              whiteclient.cpp \
              whiteconfig.cpp \
              whitegui.cpp \
              whitelogin.cpp \
              whitetimerpopup.cpp \
              whiteview.cpp
          

          Error message stays the same, save for absolute paths being used now.

          g++: error: WINDOWS -IC:/Users/User/Documents/WhiteGUI -I. -I../../../Win64/include -I../WhiteEngine -I../WhiteEngine -I../WhiteEngine -I../WhiteEngine -IC:/Qt/6.1.2/mingw81_64/include -IC:/Qt/6.1.2/mingw81_64/include/QtQuickControls2 -IC:/Qt/6.1.2/mingw81_64/include/QtQuick -IC:/Qt/6.1.2/mingw81_64/include/QtOpenGL -IC:/Qt/6.1.2/mingw81_64/include/QtWidgets -IC:/Qt/6.1.2/mingw81_64/include/QtGui -IC:/Qt/6.1.2/mingw81_64/include/QtQmlModels -IC:/Qt/6.1.2/mingw81_64/include/QtQml -IC:/Qt/6.1.2/mingw81_64/include/QtNetwork -IC:/Qt/6.1.2/mingw81_64/include/QtCore -Idebug -I. -IC:/VulkanSDK/1.0.51.0/Include -IC:/Qt/6.1.2/mingw81_64/mkspecs/win32-g++  -o debug\whiteapi.o C:\Users\User\Documents\WhiteGUI\whiteapi.cpp: No such file or directory
          g++: fatal error: no input files
          compilation terminated.
          

          The message clearly seems misleading as the file claimed to be missing is actually existing:

          C:\Users\User\Documents\WhiteGUI>dir whiteapi.cpp
           Datenträger in Laufwerk C: ist Windows
           Volumeseriennummer: B2A1-AA19
          
           Verzeichnis von C:\Users\User\Documents\WhiteGUI
          
          17.07.2021  07:26            16.140 whiteapi.cpp
                         1 Datei(en),         16.140 Bytes
                         0 Verzeichnis(se), 160.223.092.736 Bytes frei
          
          C:\Users\User\Documents\WhiteGUI>
          
          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by JonB
          #8

          @AxelVienna
          I could be wrong, but I am not 100% convinced that error message is saying quite what you think it is, from the way it is written. (It actually looks to me as though the whole long command line is being passed/treated as naming one file...?)

          Your error message starts:

          g++: error: WINDOWS -IC:/Users/User/Documents/WhiteGUI ...
          

          Where is that plain word WINDOWS at the beginning coming from?

          P.S.
          If you open a Command Prompt and try, say,

          gcc "WINDOWS -IC:/Users/User/Documents/WhiteGUI -o debug\whiteapi.o C:\Users\User\Documents\WhiteGUI\whiteapi.cpp"
          

          Note the quoting I have put in. How does the error message read for this? (Interested to see whether it echoes this whole line back with : No such file or directory at the end?)

          1 Reply Last reply
          3
          • AxelViennaA Offline
            AxelViennaA Offline
            AxelVienna
            wrote on last edited by
            #9

            WINDOWS results from a define in the build target.

            DEFINES+=WINDOWS
            

            C++ and Python walk into a bar. C++ reuses the first glass.

            JonBJ Christian EhrlicherC KroMignonK 3 Replies Last reply
            0
            • AxelViennaA AxelVienna

              WINDOWS results from a define in the build target.

              DEFINES+=WINDOWS
              
              JonBJ Online
              JonBJ Online
              JonB
              wrote on last edited by
              #10

              @AxelVienna
              I don't know how that causes gcc WINDOWS ..., which does not look right to me....

              In any case, I put in a P.S. for you to try, to see whether my suspicion is correct or mistaken?

              1 Reply Last reply
              0
              • AxelViennaA AxelVienna

                WINDOWS results from a define in the build target.

                DEFINES+=WINDOWS
                
                Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #11

                @AxelVienna said in Qt Creator not compiling on Windows 10:

                DEFINES+=WINDOWS

                This is not in your pro file you posted above

                @JonB : good catch

                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
                • AxelViennaA Offline
                  AxelViennaA Offline
                  AxelVienna
                  wrote on last edited by
                  #12

                  You are right, it is not in the .pro file. It is set in the project settings for the compile kit under “additional commands”. I use that excessively to trigger conditional code for different targets.
                  As your suggested command line input delivers the same error, I will give it a try and eliminate it.

                  C++ and Python walk into a bar. C++ reuses the first glass.

                  Christian EhrlicherC 1 Reply Last reply
                  0
                  • AxelViennaA AxelVienna

                    WINDOWS results from a define in the build target.

                    DEFINES+=WINDOWS
                    
                    KroMignonK Offline
                    KroMignonK Offline
                    KroMignon
                    wrote on last edited by
                    #13

                    @AxelVienna said in Qt Creator not compiling on Windows 10:

                    WINDOWS results from a define in the build target.
                    DEFINES+=WINDOWS

                    I can not find this in the project file from your first post.
                    But in this project, you have included 3 times APIKeyGUI.ui in FORMS and added 4 times ../WhiteEngine in INCLUDEPATH.

                    Perhaps you should first cleanup the pro file and remove redundant informations?

                    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                    1 Reply Last reply
                    0
                    • AxelViennaA AxelVienna

                      You are right, it is not in the .pro file. It is set in the project settings for the compile kit under “additional commands”. I use that excessively to trigger conditional code for different targets.
                      As your suggested command line input delivers the same error, I will give it a try and eliminate it.

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

                      @AxelVienna said in Qt Creator not compiling on Windows 10:

                      It is set in the project settings for the compile kit under “additional commands”.

                      Why? Why do you think when you enter something there QtCreator magically knows that it should be a define and be prefixed with '-DWINDOWS'?
                      No need for such a define at all - WIN32 is defined by default with every windows compiler.

                      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
                      2
                      • AxelViennaA Offline
                        AxelViennaA Offline
                        AxelVienna
                        wrote on last edited by
                        #15

                        Well, as I said in the very beginning: Most likely, I have made a stupid configuration mistake.
                        Thanks to all for pointing me to the right spot.

                        C++ and Python walk into a bar. C++ reuses the first glass.

                        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