[Feedback on issues] deepin v25 安装flutter 运行桌面端程序,编译报错 Resolved
Tofloor
poster avatar
donnchao
deepin
2025-06-28 12:22
Author

deepin v25 安装flutter 运行桌面端程序,编译报错

donnchao@donnchao-PC:~/Documents/flutter_application_1$ flutter build linux

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
CMake Error at /usr/share/cmake-3.31/Modules/CMakeTestCXXCompiler.cmake:73 (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/donnchao/Documents/flutter_application_1/build/linux/x64/release/CMakeFiles/CMakeScratch/TryCompile-ytie3H'

Run Build Command(s): /usr/bin/ninja -v cmTC_5fa6a
[1/2] /usr/bin/clang++    -MD -MT CMakeFiles/cmTC_5fa6a.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_5fa6a.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_5fa6a.dir/testCXXCompiler.cxx.o -c /home/donnchao/Documents/flutter_application_1/build/linux/x64/release/CMakeFiles/CMakeScratch/TryCompile-ytie3H/testCXXCompiler.cxx
[2/2] : && /usr/bin/clang++   CMakeFiles/cmTC_5fa6a.dir/testCXXCompiler.cxx.o -o cmTC_5fa6a   && :
FAILED: cmTC_5fa6a 
: && /usr/bin/clang++   CMakeFiles/cmTC_5fa6a.dir/testCXXCompiler.cxx.o -o cmTC_5fa6a   && :
/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...
Unable to generate build files

image.png

Reply Favorite View the author
All Replies
DebuggerX
deepin
2025-06-28 14:12
#1

我前段时间在v23上碰到了这个问题,最后查下来,是因为系统同时装了gcc-12和gcc-13导致的,试试把其中一个卸掉再编译看看。

卸的时候小心一点,别把依赖搞崩了……

Reply View the author
心持恒
deepin
2025-08-01 12:37
#2

v25遇到相同的问题,根据楼上的提示,clang++ -v果然找到了gcc13

但这个gcc13并不完整

果然使用clang++直接编译helloword文件提示缺库,链接到gcc12成功,问题找到

purge gcc13 clang再装一次clang免得自己手动配置,解决了问题

Reply View the author
donnchao
deepin
2025-09-28 21:43
#3

果然是,先关掉只读文件系统(deepin-immutable-writable enable), 再删掉/usr/lib/gcc/x86_64-linux-gnu/13目录就可以了

Reply View the author