我正在尝试构建一个flutter桌面应用程序。我按照这里的配置https://docs.flutter.dev/desktop安装了visual studio 2022,并添加了使用c++的桌面开发。
但是当我试着运行一个桌面应用程序时,它说
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.
Exception: Unable to generate build files
这是我医生
[√] 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!
这是导致错误的cmake行
# Project-level configuration.
cmake_minimum_required(VERSION 3.14)
project(truck_scale LANGUAGES CXX) <---
我试了太多的解决办法,但都没有成功。
1条答案
按热度按时间bvhaajcl1#
当我使用C++修改桌面开发并安装Windows 10 SDK10.0.20348.0而不是10.0.19041.0时,问题得到了解决