Ubuntu升级导致flutter构建失败:是lstdc++还是gcc或clang++ ?



在例行升级Ubuntu后,我的系统构建失败。它现在使用gcc 14,我猜它想要13?

我试着按照这里的说明,但我不知道如何做syslink

请一步步告诉我该打什么。

错误构建输出如下:

CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
The C++ compiler
"/usr/bin/clang++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /mnt/Data/git/tipitaka-pali-reader/build/linux/x64/release/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/ninja cmTC_4da98 && [1/2] Building CXX object CMakeFiles/cmTC_4da98.dir/testCXXCompiler.cxx.o
[2/2] Linking CXX executable cmTC_4da98
FAILED: cmTC_4da98 
: && /usr/bin/clang++   CMakeFiles/cmTC_4da98.dir/testCXXCompiler.cxx.o -o cmTC_4da98   && :
/usr/bin/ld: cannot find -lstdc++: No such file or directory
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)

Building Linux application...                                           
Unable to generate build files

扑动医生在下面:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.7, on Ubuntu 22.04.1 LTS 5.15.0-53-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.73.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

我很确定我需要13。它被安装和重新安装,但没有显示如下:

$ clang++ --version
Ubuntu clang version 14.0.0-1ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

看起来好像没有列出新的依赖项。https://github.com/flutter/flutter/issues/115909

重新安装所有依赖项(现在包含在这里)

sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev

相关内容

最新更新