Home > Software design >  Flutter error: No CMAKE_CXX_COMPILER could be found
Flutter error: No CMAKE_CXX_COMPILER could be found

Time:03-29

I am new to flutter, when I want to run my flutter app on windows I get this error:

Launching lib\main.dart on Windows in debug mode...
CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_CXX_COMPILER could be found.



Building Windows application...
Exception: Unable to generate build files

here is the output of flutter doctor -v:

[√] Flutter (Channel stable, 2.10.4, on Microsoft Windows [Version 10.0.19043.1586], locale en-US)
    • Flutter version 2.10.4 at E:\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c860cba910 (4 days ago), 2022-03-25 00:23:12 -0500
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc4)
    • Android SDK at C:\Users\moham\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0-rc4
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.8 10-b944.6842174)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.2)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.1.32319.34
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 4.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8 10-b944.6842174)

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19043.1586]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 99.0.4844.84
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 98.0.1108.62

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

everything is ok I don't know where is the problem!

I read all the previous answers but nothing worked for me

if I forgot to mention something please tell me, and thanks.

CodePudding user response:

maybe go to android studio

file > sittings > appearance & Behavior > System Settings > SDK Tools

Check if the CMake filed is checked

another one :

Check if the developer option is checked in

(in windows) > Sittings > Update & Security > for developers > developer mode (if its off make it on)

CodePudding user response:

Here is two possibility to solve this problem

  1. Try to reinstalled the Windows SDK and run again

  2. Install the sudo apt-get install build-essential

  • Related