gpt4 book ai didi

Flutter linux 在 Ubuntu 22.04 LTS CMake 错误上构建

转载 作者:行者123 更新时间:2023-12-04 18:42:26 29 4
gpt4 key购买 nike

我有 flutter 项目,可以在 Ubuntu 20.04 上成功构建。现在我想在 Ubuntu 22.04 上构建它,但出现 CMake 错误。

CMake Error at /snap/flutter/111/usr/share/cmake-3.10/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler

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

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/arzak/StudioProjects/testlinux/build/linux/x64/debug/CMakeFiles/CMakeTmp

Run Build Command:"/snap/flutter/current/usr/bin/ninja" "cmTC_38e6c"
[1/2] Building CXX object CMakeFiles/cmTC_38e6c.dir/testCXXCompiler.cxx.o
[2/2] Linking CXX executable cmTC_38e6c
FAILED: cmTC_38e6c
: && /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 -ldl -L/snap/flutter/current/usr/lib/ CMakeFiles/cmTC_38e6c.dir/testCXXCompiler.cxx.o -o cmTC_38e6c && :
/snap/flutter/current/usr/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0008002
/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libgcc_s.so.1: undefined reference to `_dl_find_object@GLIBC_2.35'
//lib/x86_64-linux-gnu/libgpg-error.so.0: undefined reference to `__libc_single_threaded@GLIBC_2.32'
//lib/x86_64-linux-gnu/libgpg-error.so.0: undefined reference to `pthread_mutex_trylock@GLIBC_2.34'
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)

我已经使用 sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev 安装了 clang 和其他软件

这是 flutter doctor 结果

[✓] Flutter (Channel stable, 3.0.0, on Ubuntu 22.04 LTS 5.15.0-27-generic,
locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version
32.1.0-rc1)
[✗] Chrome - develop for the web (Cannot find Chrome executable at
google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2021.2)
[✓] Connected device (1 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category.

最佳答案

感谢Pkrarakal ,我关注他suggestion错误消失了。试试这个步骤:

  • 移动到边缘 channel ,snap refresh flutter --edge
  • 运行 flutter upgrade
  • 删除构建目录 rm -r build/
  • 再次运行应用程序 flutter flutter run -d linux

关于Flutter linux 在 Ubuntu 22.04 LTS CMake 错误上构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72223978/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com