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.2k 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 jasoney

    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.
    
    Christian EhrlicherC Offline
    Christian EhrlicherC Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on 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
    0
    • Christian EhrlicherC Christian Ehrlicher

      @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 last edited by
      #3

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

      Christian EhrlicherC 1 Reply Last reply
      0
      • J jasoney

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

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 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
        0
        • Christian EhrlicherC Christian Ehrlicher

          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 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
          0
          • J jasoney

            @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 last edited by
            #6

            Update: QMake works.

            J 1 Reply Last reply
            0
            • J jasoney

              Update: QMake works.

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

              I might just try reinstalling Qt.

              1 Reply Last reply
              0
              • J jasoney

                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.
                
                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on 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
                0
                • jsulmJ jsulm

                  @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 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
                  
                  Christian EhrlicherC 1 Reply Last reply
                  0
                  • J jasoney

                    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
                    
                    Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on 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
                    1
                    • Christian EhrlicherC Christian Ehrlicher

                      Remove all cygwin related stuff from your PATH env var.

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

                      @Christian-Ehrlicher I still get the same error

                      Christian EhrlicherC 1 Reply Last reply
                      0
                      • J jasoney

                        @Christian-Ehrlicher I still get the same error

                        Christian EhrlicherC Offline
                        Christian EhrlicherC Offline
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote on 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
                        1
                        • Christian EhrlicherC Christian Ehrlicher

                          @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 last edited by
                          #13

                          @Christian-Ehrlicher Fixed it 👍 Thank you

                          1 Reply Last reply
                          1
                          • J jasoney has marked this topic as solved on

                          • Login

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