执行flutter run -d linux时Flutter Linux生成错误

qq24tv8q  于 2023-10-16  发布在  Linux
关注(0)|答案(4)|浏览(91)

Flutter医生未显示任何问题。会有什么问题呢?
执行:flutter run -d Linux
显示以下内容:
CMake Error at /snap/flutter/81/usr/share/cmake-3.10/Modules/CMakeTestCXXplayer.cmake:45(message):C++编译器

"/snap/flutter/current/usr/bin/clang++"

无法编写简单的测试程序。
失败,输出如下:

Change Dir: /home/work/AndroidStudioProjects/myapp/build/linux/x64/debug/CMakeFiles/CMakeTmp
                                                                    
Run Build Command:"/snap/flutter/current/usr/bin/ninja" "cmTC_0475b"
[1/2] Building CXX object CMakeFiles/cmTC_0475b.dir/testCXXCompiler.cxx.o
[2/2] Linking CXX executable cmTC_0475b                             
FAILED: cmTC_0475b       
 : && /snap/flutter/current/usr/bin/clang++    -L/snap/flutter/current/usr/lib/gcc/x86_64-linux-gnu/8 -L/snap/flutter/current/usr/lib/x86_64-linux-gnu -lblkid -lgcrypt -llzma -lpthread -L/snap/flutter/current/usr/lib/ -L/snap/flutter/current/usr/lib/gcc/x86_64-linux-gnu/8 -L/snap/flutter/current/usr/lib/x86_64-linux-gnu -lblkid -lgcrypt -llzma -lpthread -L/snap/flutter/current/usr/lib/ CMakeFiles/cmTC_0475b.dir/testCXXCompiler.cxx.o  -o cmTC_0475b   && :
/snap/flutter/current/usr/lib/x86_64-linux-gnu/libgcrypt.so: undefined reference to `gpgrt_get_syscall_clamp@GPG_ERROR_1.0'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.                                                                                                                                                                           CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project)
bfnvny8b

bfnvny8b1#

Linux Mint 20.2 CinnamonFlutter 2.5.2snap 2.51.7我固定通过做

sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
flutter clean
flutter run -d linux
mwg9r5ms

mwg9r5ms2#

2021年4月15日发布的Flutter(https://snapcraft.io/flutter)的Snap版本存在问题。
解决方案是手动安装(https://flutter.dev/docs/get-started/install/linux#install-flutter-manually)

ca1c2owp

ca1c2owp3#

我在ubuntu 22.04上遇到了同样的问题,使用flutter文档构建和发布Linux应用程序,并在此处安装snapcraft https://docs.flutter.dev/deployment/linux

py49o6xq

py49o6xq4#

我重新安装我的薄荷和安装Flutter手动和得到同样的问题

相关问题