Iam trying to build a flutter desktop application . i followed the configuration here https://docs.flutter.dev/desktop i installed visual studio 2022 with and add Desktop development with C++ to it .
but when i tried to run a run a desktop application it said
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.
Exception: Unable to generate build files
here is my flutter doctor
[√] Flutter (Channel master, 3.1.0-0.0.pre.1111, on Microsoft Windows [Version 10.0.19043.1706], locale en-US)
• Flutter version 3.1.0-0.0.pre.1111 at E:\softwares\flutter\flutter_windows_2.0.5-stable\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 52c47e96a3 (7 days ago), 2022-06-05 08:03:02 -0400
• Engine revision 075947bf4d
• Dart version 2.18.0 (build 2.18.0-170.0.dev)
• DevTools version 2.14.0
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc3)
• Android SDK at C:\Users\zamzam107019\AppData\Local\Android\sdk
• Platform android-31, build-tools 31.0.0-rc3
• Java binary at: E:\softwares\flutter\android studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.3)
• Visual Studio at E:\vs community
• Visual Studio Community 2022 version 17.2.32526.322
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2021.2)
• Android Studio at E:\softwares\flutter\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.12+7-b1504.28-7817840)
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19043.1706]
• Chrome (web) • chrome • web-javascript • Google Chrome 102.0.5005.63
• Edge (web) • edge • web-javascript • Microsoft Edge 102.0.1245.39
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
and this is the cmake line that cause the error
# Project-level configuration.
cmake_minimum_required(VERSION 3.14)
project(truck_scale LANGUAGES CXX) <---
i tried too many solution but no thing succeeded
It solved when i modified Desktop development with C++ and installed Windows 10 SDK 10.0.20348.0 instead of 10.0.19041.0