Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux build error CMake Error #45

Closed
shophk opened this issue May 5, 2021 · 31 comments
Closed

linux build error CMake Error #45

shophk opened this issue May 5, 2021 · 31 comments

Comments

@shophk
Copy link

shophk commented May 5, 2021

Flutter doctor did not indicate any issues.

Running: flutter run -d linux

I get the following:

CMake Error at /snap/flutter/81/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/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)

@MarcusTomlinson
Copy link
Contributor

Hi @shophk, could you tell me what distro and version you're running into this on?

@Rashik4567
Copy link

Rashik4567 commented Jul 17, 2021

Hi @shophk, could you tell me what distro and version you're running into this on?

I also got this issue on fedora 34. @MarcusTomlinson

@gmstyle
Copy link

gmstyle commented Jul 25, 2021

Hi, same problem for me on Fedora 34 with flutter from snap.

@kenvandine
Copy link
Collaborator

I'm seeing something similar on impish

CMake Error at /snap/flutter/91/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/ken/src/github/canonical/firmware-updater/build/linux/x64/debug/CMakeFiles/CMakeTmp

Run Build Command:"/snap/flutter/current/usr/bin/ninja" "cmTC_7a859"
[1/2] Building CXX object CMakeFiles/cmTC_7a859.dir/testCXXCompiler.cxx.o
[2/2] Linking CXX executable cmTC_7a859
FAILED: cmTC_7a859 
: && /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_7a859.dir/testCXXCompiler.cxx.o  -o cmTC_7a859   && :
/snap/flutter/current/usr/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0008002
/snap/flutter/current/usr/bin/ld: warning: //lib/x86_64-linux-gnu/libdl.so.2: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0008002
//lib/x86_64-linux-gnu/libdl.so.2: undefined reference to `_dl_catch_error_ptr@GLIBC_PRIVATE'
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)

@MarcusTomlinson
Copy link
Contributor

@shophk @Rashik4567 @gmstyle @kenvandine could you please try the snap from edge and let me know if the issue is now resolved:

snap refresh flutter --edge

@EmixamPP
Copy link

@MarcusTomlinson Does not work for me :/ (Fedora 34 too)

@MarcusTomlinson
Copy link
Contributor

Please try refresh again. Thanks.

@kenvandine
Copy link
Collaborator

The flutter snap in the edge channel should fix this. I've confirmed it on impish, 20.04, fedora 32 and fedora 34. Please let me know if able to still reproduce it.

@pkarakal
Copy link

I had the same error on Fedora 34 and got it working by

  • moving to edge channel, snap refresh flutter --edge
  • running flutter upgrade
  • deleting build directory rm -r build/
  • running the application again flutter run -d linux

@kenvandine
Copy link
Collaborator

This should be fixed with revision 101

@the-loudspeaker
Copy link

the-loudspeaker commented Nov 11, 2021

Hey! I have tried the edge version of flutter and also did a flutter upgrade but I am still facing the issue in fedora 35. My app gives the following output:

Run Build Command:"/snap/flutter/current/usr/bin/ninja" "cmTC_ed1c2"
    [1/2] Building CXX object CMakeFiles/cmTC_ed1c2.dir/testCXXCompiler.cxx.o
[CMakeError.log](https://github.com/canonical/flutter-snap/files/7523046/CMakeError.log)

    [2/2] Linking CXX executable cmTC_ed1c2
    FAILED: cmTC_ed1c2 

I am on flutter revison 101. Could it be possible the issue is due to something else?
CMakeError.log

Edit: Attached the complete error file.

@tredeneo
Copy link

tredeneo commented Nov 20, 2021

I am on flutter revison 101. Could it be possible the issue is due to something else?

same error here also in fedora 35 and edge version

@diysumit
Copy link

diysumit commented Nov 21, 2021

Still getting this error. I am using openSUSE Tumbleweed, tried edge version and above steps no joy.

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/diysumit/development/flutter-apprentice/fooderlich/build/linux/x64/debug/CMakeFiles/CMakeTmp

    Run Build Command:"/snap/flutter/current/usr/bin/ninja" "cmTC_2a127"
    [1/2] Building CXX object CMakeFiles/cmTC_2a127.dir/testCXXCompiler.cxx.o
    [2/2] Linking CXX executable cmTC_2a127
    FAILED: cmTC_2a127 
    : && /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/ -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_2a127.dir/testCXXCompiler.cxx.o  -o cmTC_2a127   && :
    /snap/flutter/current/usr/bin/ld: warning: /lib/../lib64/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0008002
    /snap/flutter/current/usr/bin/ld: warning: /lib/../lib64/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
    /snap/flutter/current/usr/bin/ld: warning: /lib/../lib64/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
    /snap/flutter/current/usr/bin/ld: warning: /lib/../lib64/crti.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
    /snap/flutter/current/usr/bin/ld: warning: /lib/../lib64/crti.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
    /snap/flutter/current/usr/bin/ld: /lib/../lib64/crti.o: unable to initialize decompress status for section .debug_line
    /snap/flutter/current/usr/bin/ld: /lib/../lib64/crti.o: unable to initialize decompress status for section .debug_line
    /lib/../lib64/crti.o: file not recognized: File format not recognized
    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...                                           
Exception: Unable to generate build files

@JoshuaNitschke
Copy link

JoshuaNitschke commented Nov 26, 2021

@MarcusTomlinson I'm having the same issue as @diysumit - I'm also on Tumbleweed.

@fasibio
Copy link

fasibio commented Nov 27, 2021

@MarcusTomlinson I'm having the same issue as @diysumit - I'm also on Tumbleweed.

I am have this issue also and I am a little bit wondered why a issue is so fast closed...

Flutter (Channel stable, 2.5.3, on Fedora Linux 35 (Workstation Edition) 5.14.18-300.fc35.x86_64, locale de_DE.UTF-8)

@the-loudspeaker
Copy link

the-loudspeaker commented Nov 27, 2021

I am have this issue also and I am a little bit wondered why a issue is so fast closed...

+1

I don't face this issue on flutter from tar file. Only happens on the snap.

@JoshuaNitschke
Copy link

Are we not going to reopen this @kenvandine ?

@kenvandine
Copy link
Collaborator

The more recent comments here are different than the original report.

Are you seeing this error:

snap/flutter/current/usr/lib/x86_64-linux-gnu/libgcrypt.so: undefined reference to `gpgrt_get_syscall_clamp@GPG_ERROR_1.0'

If not, please open a new issue. We should have updated the title of the original report to be more specific.

I was able to reproduce that issue on fedora 34 and 35, then confirmed the fix for the libgcrypt issue.

Please open a new issue, with as many specifics as you can, including distro and version. Also please try to reproduce it with a fresh project.

$ flutter create testcase
$ cd testcase
$ flutter build linux

Thanks

@JoshuaNitschke
Copy link

@kenvandine - you are correct. I have made a new issue: #60

@Marflage
Copy link

Marflage commented May 6, 2022

I am facing the same problem on Ubuntu 22.04 using Android Studio Bumblebee 2021.1.1 Patch 1.
Here is the complete error:

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/istabraq/Documents/revising_flutter/build/linux/x64/debug/CMakeFiles/CMakeTmp

    Run Build Command:"/snap/flutter/current/usr/bin/ninja" "cmTC_a45ff"
    [1/2] Building CXX object CMakeFiles/cmTC_a45ff.dir/testCXXCompiler.cxx.o
    [2/2] Linking CXX executable cmTC_a45ff
    FAILED: cmTC_a45ff 
    : && /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_a45ff.dir/testCXXCompiler.cxx.o  -o cmTC_a45ff   && :
    /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:2 (project)


Exception: Unable to generate build files

Note: Using the flutter snap from Gnome store.

@Torbatti
Copy link

im running arch , facing the same issue
it seems that it hasnt been fixed yet

Launching lib/main.dart on Linux in debug mode...
CMake Error at /var/lib/snapd/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/torbatti/Main/Devel/Flutter/p1/learningdart/build/linux/x64/debug/CMakeFiles/CMakeTmp

    Run Build Command:"/snap/flutter/current/usr/bin/ninja" "cmTC_278d5"
    [1/2] Building CXX object CMakeFiles/cmTC_278d5.dir/testCXXCompiler.cxx.o
    [2/2] Linking CXX executable cmTC_278d5
    FAILED: cmTC_278d5
    : && /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_278d5.dir/testCXXCompiler.cxx.o  -o cmTC_278d5   && :
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0008002
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crti.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crti.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/crtbegin.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/crtbegin.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/libgcc_s.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/libgcc_s.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/libgcc_s.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/libgcc_s.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/crtend.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/crtend.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crtn.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
    /snap/flutter/current/usr/bin/ld: warning: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crtn.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
    /snap/flutter/current/usr/bin/ld: warning: //usr/lib32/libgpg-error.so.0: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
    /snap/flutter/current/usr/bin/ld: warning: //usr/lib32/libgpg-error.so.0: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
    /snap/flutter/current/usr/bin/ld: warning: //lib64/libgpg-error.so.0: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
    /snap/flutter/current/usr/bin/ld: warning: //lib64/libgpg-error.so.0: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
    //lib64/libgpg-error.so.0: undefined reference to `__libc_single_threaded@GLIBC_2.32'
    //lib64/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:2 (project)
Exception: Unable to generate build files
Exited (sigterm)

@devius
Copy link

devius commented May 11, 2022

Same error here on Ubuntu 22.04

`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/devi/Development/tt/build/linux/x64/debug/CMakeFiles/CMakeTmp

Run Build Command:"/snap/flutter/current/usr/bin/ninja" "cmTC_b07fb"
[1/2] Building CXX object CMakeFiles/cmTC_b07fb.dir/testCXXCompiler.cxx.o
[2/2] Linking CXX executable cmTC_b07fb
FAILED: cmTC_b07fb 
: && /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/ -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_b07fb.dir/testCXXCompiler.cxx.o  -o cmTC_b07fb   && :
/lib/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:2 (project)
`

@magicmike
Copy link

magicmike commented May 11, 2022

Same issue with Ubuntu 22.04 using Android Studio Bumblebee

Launching lib/main.dart on Linux in debug mode...
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/dirk/AndroidStudioProjects/github_client/build/linux/x64/debug/CMakeFiles/CMakeTmp

    Run Build Command:"/snap/flutter/current/usr/bin/ninja" "cmTC_5456d"
    [1/2] Building CXX object CMakeFiles/cmTC_5456d.dir/testCXXCompiler.cxx.o
    [2/2] Linking CXX executable cmTC_5456d
    FAILED: cmTC_5456d 
    : && /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/ -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_5456d.dir/testCXXCompiler.cxx.o  -o cmTC_5456d   && :
    /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:2 (project)

Building Linux application...
Exception: Unable to generate build files

@arzakmiftakhul
Copy link

Same issue with Ubuntu 22.04 using Android Studio Bumblebee

Launching lib/main.dart on Linux in debug mode... 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/dirk/AndroidStudioProjects/github_client/build/linux/x64/debug/CMakeFiles/CMakeTmp

    Run Build Command:"/snap/flutter/current/usr/bin/ninja" "cmTC_5456d"
    [1/2] Building CXX object CMakeFiles/cmTC_5456d.dir/testCXXCompiler.cxx.o
    [2/2] Linking CXX executable cmTC_5456d
    FAILED: cmTC_5456d 
    : && /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/ -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_5456d.dir/testCXXCompiler.cxx.o  -o cmTC_5456d   && :
    /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:2 (project)

Building Linux application... Exception: Unable to generate build files

I use Ubuntu 22.04 LTS and android studio Chipmunk. My problem was gone after I followed this @pkarakal suggestion.

@MiekVenter
Copy link

Installing missing tools fixed it for me. See "Update your tools with the SDK Manager" https://developer.android.com/studio/intro/update#sdk-manager

@viniciusddrft
Copy link

No arch linux eu tive o mesmo erro.

flutter 3.0.0
dart 2.17.0
kernel 5.17.7-arch1-1

@adarshmaharjan
Copy link

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/adarsh/Desktop/learning/test_flutter/build/linux/x64/debug/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_77c27 && [1/2] Building CXX object CMakeFiles/cmTC_77c27.dir/testCXXCompiler.cxx.o
[2/2] Linking CXX executable cmTC_77c27
FAILED: cmTC_77c27 
: && /usr/bin/clang++   CMakeFiles/cmTC_77c27.dir/testCXXCompiler.cxx.o -o cmTC_77c27   && :
/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:3 (project)

Building Linux application...
Exception: Unable to generate build files

adarsh@pop-os:~/Desktop/learning/test_flutter$ flutter doctor -v
[✓] Flutter (Channel stable, 3.3.9, on Pop!_OS 22.04 LTS 6.0.6-76060006-generic,
locale en_US.UTF-8)
• Flutter version 3.3.9 on channel stable at /home/adarsh/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b8f7f1f986 (5 days ago), 2022-11-23 06:43:51 +0900
• Engine revision 8f2221fbef
• Dart version 2.18.5
• DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /home/adarsh/Android/Sdk
• Platform android-33, build-tools 33.0.1
• Java binary at:
/home/adarsh/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.71
72.25.2113.9123335/jre/bin/java
• Java version OpenJDK Runtime Environment (build
11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.

[✓] Chrome - develop for the web
• Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
• Ubuntu clang version 14.0.0-1ubuntu1
• cmake version 3.22.1
• ninja version 1.10.1
• pkg-config version 0.29.2

[✓] Android Studio (version 2021.3)
• Android Studio at
/home/adarsh/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.71
72.25.2113.9123335
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.73.1)
• VS Code at /usr/share/code
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • Pop!_OS 22.04 LTS
6.0.6-76060006-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.121

[✓] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!

I having same issue using flutter from git with flutter channel stable

@ZhulanovAA
Copy link

I'm having the same issue as adarshmaharjan and it seems that we are both having it on PopOS so it might be related. I've updated both Flutter and PopOS since last succesful build, so it's not clear which one might be responsible for the issue

@kenvandine
Copy link
Collaborator

I've tried this on both 22.10 and 22.04, and haven't been able to reproduce it. Based on the comment from @adarshmaharjan, who reproduced this outside of the flutter snap, it's clearly not a snap specific issue.

@hansmboron
Copy link

I'm having the same issue as adarshmaharjan and it seems that we are both having it on PopOS so it might be related. I've updated both Flutter and PopOS since last succesful build, so it's not clear which one might be responsible for the issue

The same thing with me

@ZhulanovAA
Copy link

ZhulanovAA commented Dec 2, 2022

@hansmboron, @adarshmaharjan, this issue can be solved by installing new dependency (more details here). Though indeed, this issue isn't related to the snap version of futter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests