在今天晚上 ubuntu 22.04 执行如下升级命令之后
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ sudo apt-get dist-upgrade 正在读取软件包列表... 完成 正在分析软件包的依赖关系树... 完成 正在读取状态信息... 完成 正在计算更新... 完成 下列【新】软件包将被安装: cpp-12 gcc-12 libasan8 libgcc-12-dev libtsan2 下列软件包将被升级: apport apport-gtk dkms firmware-sof-signed libexpat1 libexpat1:i386 libexpat1-dev libflac8 libfreerdp-client2-2 libfreerdp-server2-2 libfreerdp2-2 libwinpr2-2 python3-apport python3-problem-report rsync xserver-common xserver-xephyr xserver-xorg-core xserver-xorg-legacy xwayland 升级了 20 个软件包,新安装了 5 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。 |
再次执行 flutter 的构建命令,报错。
操作过程如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
$ flutter run Launching lib/main.dart on Linux in debug mode... Building Linux application... /usr/include/glib-2.0/glib/glib-typeof.h:39:10: fatal error: 'type_traits' file not found /usr/include/glib-2.0/glib/glib-typeof.h:39:10: fatal error: 'type_traits' file not found Exception: Build process failed $ flutter --version Flutter 3.3.9 • channel stable • https://github.com/flutter/flutter.git Framework • revision b8f7f1f986 (2 天前) • 2022-11-23 06:43:51 +0900 Engine • revision 8f2221fbef Tools • Dart 2.18.5 • DevTools 2.15.0 $ flutter clean $ flutter run Multiple devices found: Linux (desktop) • linux • linux-x64 • Ubuntu 22.04.1 LTS 5.15.0-53-generic Chrome (web) • chrome • web-javascript • Chromium 107.0.5304.110 [1]: Linux (linux) [2]: Chrome (chrome) Please choose one (To quit, press "q/Q"): 1 Running "flutter pub get" in xxxx... 6.2s Launching lib/main.dart on Linux in debug mode... 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: /home/xxxx/xxxx/xxxxx/build/linux/x64/debug/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/ninja cmTC_8cfda && [1/2] Building CXX object CMakeFiles/cmTC_8cfda.dir/testCXXCompiler.cxx.o [2/2] Linking CXX executable cmTC_8cfda FAILED: cmTC_8cfda : && /usr/bin/clang++ CMakeFiles/cmTC_8cfda.dir/testCXXCompiler.cxx.o -o cmTC_8cfda && : /usr/bin/ld: 找不到 -lstdc++: 没有那个文件或目录 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:3 (project) Building Linux application... Exception: Unable to generate build files |
解决方法是手工安装依赖:
1 |
$ sudo apt install lib32stdc++-12-dev |
之后再执行构建命令。