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. Unable to build example projects due to CMake error
Forum Updated to NodeBB v4.3 + New Features

Unable to build example projects due to CMake error

Scheduled Pinned Locked Moved Solved Installation and Deployment
13 Posts 3 Posters 1.1k 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
    jasoney
    wrote on 12 Jul 2023, 15:50 last edited by
    #1

    I am trying out Qt for the first time. When I tried to build the coffee machine example, CMake gave this error, and I haven't been able to solve it.

    Running C:\cygwin64\bin\cmake.exe -S C:/Qt/Examples/Qt-6.5.1/demos/calqlatr -B C:/Qt/Examples/Qt-6.5.1/demos/build-calqlatr-Desktop_Qt_6_5_1_MinGW_64_bit-Debug in C:\Qt\Examples\Qt-6.5.1\demos\build-calqlatr-Desktop_Qt_6_5_1_MinGW_64_bit-Debug.
    -- The CXX compiler identification is unknown
    CMake Error at CMakeLists.txt:5 (project):
      The CMAKE_CXX_COMPILER:
    
        C:/Qt/Tools/mingw1120_64/bin/g++.exe
    
      is not a full path and was not found in the PATH.
    
      Tell CMake where to find the compiler by setting either the environment
      variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
      to the compiler, or to the compiler name if it is in the PATH.
    
    
    -- Configuring incomplete, errors occurred!
    CMake process exited with exit code 1.
    
    C J 2 Replies Last reply 12 Jul 2023, 15:50
    0
    • J jasoney
      15 Jul 2023, 18:32

      @Christian-Ehrlicher I still get the same error

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 15 Jul 2023, 18:42 last edited by
      #12

      @jasoney said in Unable to build example projects due to CMake error:

      I still get the same error

      Remove the build dir and run cmake again, if it still complains about it you still have a cygwin PATH somewhere - remove it.

      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 15 Jul 2023, 18:54
      1
      • J jasoney
        12 Jul 2023, 15:50

        I am trying out Qt for the first time. When I tried to build the coffee machine example, CMake gave this error, and I haven't been able to solve it.

        Running C:\cygwin64\bin\cmake.exe -S C:/Qt/Examples/Qt-6.5.1/demos/calqlatr -B C:/Qt/Examples/Qt-6.5.1/demos/build-calqlatr-Desktop_Qt_6_5_1_MinGW_64_bit-Debug in C:\Qt\Examples\Qt-6.5.1\demos\build-calqlatr-Desktop_Qt_6_5_1_MinGW_64_bit-Debug.
        -- The CXX compiler identification is unknown
        CMake Error at CMakeLists.txt:5 (project):
          The CMAKE_CXX_COMPILER:
        
            C:/Qt/Tools/mingw1120_64/bin/g++.exe
        
          is not a full path and was not found in the PATH.
        
          Tell CMake where to find the compiler by setting either the environment
          variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
          to the compiler, or to the compiler name if it is in the PATH.
        
        
        -- Configuring incomplete, errors occurred!
        CMake process exited with exit code 1.
        
        C Offline
        C Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 12 Jul 2023, 15:50 last edited by
        #2

        @jasoney said in Unable to build example projects due to CMake error:

        C:/Qt/Tools/mingw1120_64/bin/g++.exe

        So is this path correct?

        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 12 Jul 2023, 16:00
        0
        • C Christian Ehrlicher
          12 Jul 2023, 15:50

          @jasoney said in Unable to build example projects due to CMake error:

          C:/Qt/Tools/mingw1120_64/bin/g++.exe

          So is this path correct?

          J Offline
          J Offline
          jasoney
          wrote on 12 Jul 2023, 16:00 last edited by
          #3

          @Christian-Ehrlicher Yes
          Screenshot 2023-07-12 085150.png

          C 1 Reply Last reply 12 Jul 2023, 16:09
          0
          • J jasoney
            12 Jul 2023, 16:00

            @Christian-Ehrlicher Yes
            Screenshot 2023-07-12 085150.png

            C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 12 Jul 2023, 16:09 last edited by
            #4

            What QtCreator version do you use?
            Can you open a command prompt and try to execute g++ (with full path and correct separators)?

            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 12 Jul 2023, 16:23
            0
            • C Christian Ehrlicher
              12 Jul 2023, 16:09

              What QtCreator version do you use?
              Can you open a command prompt and try to execute g++ (with full path and correct separators)?

              J Offline
              J Offline
              jasoney
              wrote on 12 Jul 2023, 16:23 last edited by
              #5

              @Christian-Ehrlicher
              I am using QT Creator 10.0.2
              Running C:\Qt\Tools\mingw1120_64\bin\g++.exe --version:

              g++.exe (x86_64-posix-seh-rev3, Built by MinGW-W64 project) 11.2.0
              Copyright (C) 2021 Free Software Foundation, Inc.
              This is free software; see the source for copying conditions.  There is NO
              warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
              
              J 1 Reply Last reply 12 Jul 2023, 20:19
              0
              • J jasoney
                12 Jul 2023, 16:23

                @Christian-Ehrlicher
                I am using QT Creator 10.0.2
                Running C:\Qt\Tools\mingw1120_64\bin\g++.exe --version:

                g++.exe (x86_64-posix-seh-rev3, Built by MinGW-W64 project) 11.2.0
                Copyright (C) 2021 Free Software Foundation, Inc.
                This is free software; see the source for copying conditions.  There is NO
                warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
                
                J Offline
                J Offline
                jasoney
                wrote on 12 Jul 2023, 20:19 last edited by
                #6

                Update: QMake works.

                J 1 Reply Last reply 13 Jul 2023, 04:36
                0
                • J jasoney
                  12 Jul 2023, 20:19

                  Update: QMake works.

                  J Offline
                  J Offline
                  jasoney
                  wrote on 13 Jul 2023, 04:36 last edited by
                  #7

                  I might just try reinstalling Qt.

                  1 Reply Last reply
                  0
                  • J jasoney
                    12 Jul 2023, 15:50

                    I am trying out Qt for the first time. When I tried to build the coffee machine example, CMake gave this error, and I haven't been able to solve it.

                    Running C:\cygwin64\bin\cmake.exe -S C:/Qt/Examples/Qt-6.5.1/demos/calqlatr -B C:/Qt/Examples/Qt-6.5.1/demos/build-calqlatr-Desktop_Qt_6_5_1_MinGW_64_bit-Debug in C:\Qt\Examples\Qt-6.5.1\demos\build-calqlatr-Desktop_Qt_6_5_1_MinGW_64_bit-Debug.
                    -- The CXX compiler identification is unknown
                    CMake Error at CMakeLists.txt:5 (project):
                      The CMAKE_CXX_COMPILER:
                    
                        C:/Qt/Tools/mingw1120_64/bin/g++.exe
                    
                      is not a full path and was not found in the PATH.
                    
                      Tell CMake where to find the compiler by setting either the environment
                      variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
                      to the compiler, or to the compiler name if it is in the PATH.
                    
                    
                    -- Configuring incomplete, errors occurred!
                    CMake process exited with exit code 1.
                    
                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 13 Jul 2023, 05:13 last edited by
                    #8

                    @jasoney said in Unable to build example projects due to CMake error:

                    C:\cygwin64\bin\cmake.exe

                    I'm not sure but can't you install CMake via Qt installer?

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

                    J 1 Reply Last reply 15 Jul 2023, 18:03
                    0
                    • J jsulm
                      13 Jul 2023, 05:13

                      @jasoney said in Unable to build example projects due to CMake error:

                      C:\cygwin64\bin\cmake.exe

                      I'm not sure but can't you install CMake via Qt installer?

                      J Offline
                      J Offline
                      jasoney
                      wrote on 15 Jul 2023, 18:03 last edited by
                      #9

                      Using the QT CMake installation gives me this error:

                      Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Qt/Examples/Qt-6.5.1/demos/coffee -B C:/Qt/Examples/Qt-6.5.1/demos/build-coffee-Desktop_Qt_6_5_1_MinGW_64_bit-Debug in C:\Qt\Examples\Qt-6.5.1\demos\build-coffee-Desktop_Qt_6_5_1_MinGW_64_bit-Debug.
                      CMake Error at CMakeLists.txt:5 (project):
                        Running
                      
                         '/cygdrive/c/Qt/Tools/Ninja/ninja.exe' '--version'
                      
                        failed with:
                      
                         The system cannot find the file specified
                      
                      C 1 Reply Last reply 15 Jul 2023, 18:05
                      0
                      • J jasoney
                        15 Jul 2023, 18:03

                        Using the QT CMake installation gives me this error:

                        Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Qt/Examples/Qt-6.5.1/demos/coffee -B C:/Qt/Examples/Qt-6.5.1/demos/build-coffee-Desktop_Qt_6_5_1_MinGW_64_bit-Debug in C:\Qt\Examples\Qt-6.5.1\demos\build-coffee-Desktop_Qt_6_5_1_MinGW_64_bit-Debug.
                        CMake Error at CMakeLists.txt:5 (project):
                          Running
                        
                           '/cygdrive/c/Qt/Tools/Ninja/ninja.exe' '--version'
                        
                          failed with:
                        
                           The system cannot find the file specified
                        
                        C Offline
                        C Offline
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote on 15 Jul 2023, 18:05 last edited by
                        #10

                        Remove all cygwin related stuff from your PATH env var.

                        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 15 Jul 2023, 18:32
                        1
                        • C Christian Ehrlicher
                          15 Jul 2023, 18:05

                          Remove all cygwin related stuff from your PATH env var.

                          J Offline
                          J Offline
                          jasoney
                          wrote on 15 Jul 2023, 18:32 last edited by
                          #11

                          @Christian-Ehrlicher I still get the same error

                          C 1 Reply Last reply 15 Jul 2023, 18:42
                          0
                          • J jasoney
                            15 Jul 2023, 18:32

                            @Christian-Ehrlicher I still get the same error

                            C Offline
                            C Offline
                            Christian Ehrlicher
                            Lifetime Qt Champion
                            wrote on 15 Jul 2023, 18:42 last edited by
                            #12

                            @jasoney said in Unable to build example projects due to CMake error:

                            I still get the same error

                            Remove the build dir and run cmake again, if it still complains about it you still have a cygwin PATH somewhere - remove it.

                            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 15 Jul 2023, 18:54
                            1
                            • C Christian Ehrlicher
                              15 Jul 2023, 18:42

                              @jasoney said in Unable to build example projects due to CMake error:

                              I still get the same error

                              Remove the build dir and run cmake again, if it still complains about it you still have a cygwin PATH somewhere - remove it.

                              J Offline
                              J Offline
                              jasoney
                              wrote on 15 Jul 2023, 18:54 last edited by
                              #13

                              @Christian-Ehrlicher Fixed it 👍 Thank you

                              1 Reply Last reply
                              1
                              • J jasoney has marked this topic as solved on 15 Jul 2023, 18:54

                              2/13

                              12 Jul 2023, 15:50

                              11 unread
                              • Login

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