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

Errors when doing Linux build #92

Open
LuFlo opened this issue Nov 12, 2022 · 1 comment
Open

Errors when doing Linux build #92

LuFlo opened this issue Nov 12, 2022 · 1 comment

Comments

@LuFlo
Copy link

LuFlo commented Nov 12, 2022

I reopened a project which I was working on before and which I definitely built before. First I had the same issues as described on this stackoverflow: https://stackoverflow.com/questions/67396100/flutter-linux-build-error-when-executing-flutter-run-d-linux

I installed the packages which were suggested:

sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
flutter clean
flutter run -d linux

After installing the packages, I got some weird c++ compilation errors. I also tried updating to the edge-channel, I removed the build folder, ran flutter clean and rebuilt multiple times.

Launching lib/main.dart on Linux in debug mode...
Building Linux application...
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:386:2: error: #else without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:389:2: error: #endif without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:1950:2: error: #endif without #if
/snap/flutter/current/usr/include/bits/floatn.h:14:3: error: #endif without #if
/snap/flutter/current/usr/include/bits/floatn.h:16:2: error: #endif without #if
/snap/flutter/current/usr/include/bits/floatn.h:20:2: error: #endif without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:386:2: error: #else without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:389:2: error: #endif without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:1950:2: error: #endif without #if
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:15: error: expected '{'
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:15: error: C++ requires a type specifier for all declarations
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:35: error: expected expression
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:43: error: expected ';' after top level declarator
/snap/flutter/current/usr/include/c++/9/cstdlib:123:15: error: expected '{'
/snap/flutter/current/usr/include/c++/9/cstdlib:123:15: error: C++ requires a type specifier for all declarations
/snap/flutter/current/usr/include/c++/9/cstdlib:123:35: error: expected expression
/snap/flutter/current/usr/include/c++/9/cstdlib:123:43: error: expected ';' after top level declarator
/snap/flutter/current/usr/include/c++/9/stdlib.h:38:7: error: no member named 'abort' in namespace 'std'; did you mean '::abort'?
/snap/flutter/current/usr/include/c++/9/stdlib.h:39:7: error: no member named 'atexit' in namespace 'std'; did you mean '::atexit'?
fatal error: too many errors emitted, stopping now [-ferror-limit=]
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:386:2: error: #else without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:389:2: error: #endif without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:1950:2: error: #endif without #if
/snap/flutter/current/usr/include/bits/floatn.h:14:3: error: #endif without #if
/snap/flutter/current/usr/include/bits/floatn.h:16:2: error: #endif without #if
/snap/flutter/current/usr/include/bits/floatn.h:20:2: error: #endif without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:386:2: error: #else without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:389:2: error: #endif without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:1950:2: error: #endif without #if
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:15: error: expected '{'
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:15: error: C++ requires a type specifier for all declarations
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:35: error: expected expression
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:43: error: expected ';' after top level declarator
/snap/flutter/current/usr/include/c++/9/cstdlib:123:15: error: expected '{'
/snap/flutter/current/usr/include/c++/9/cstdlib:123:15: error: C++ requires a type specifier for all declarations
/snap/flutter/current/usr/include/c++/9/cstdlib:123:35: error: expected expression
/snap/flutter/current/usr/include/c++/9/cstdlib:123:43: error: expected ';' after top level declarator
/snap/flutter/current/usr/include/c++/9/stdlib.h:38:7: error: no member named 'abort' in namespace 'std'; did you mean '::abort'?
/snap/flutter/current/usr/include/c++/9/stdlib.h:39:7: error: no member named 'atexit' in namespace 'std'; did you mean '::atexit'?
fatal error: too many errors emitted, stopping now [-ferror-limit=]
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:386:2: error: #else without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:389:2: error: #endif without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:1950:2: error: #endif without #if
/snap/flutter/current/usr/include/bits/floatn.h:14:3: error: #endif without #if
/snap/flutter/current/usr/include/bits/floatn.h:16:2: error: #endif without #if
/snap/flutter/current/usr/include/bits/floatn.h:20:2: error: #endif without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:386:2: error: #else without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:389:2: error: #endif without #if
/snap/flutter/current/usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:1950:2: error: #endif without #if
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:15: error: expected '{'
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:15: error: C++ requires a type specifier for all declarations
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:35: error: expected expression
/snap/flutter/current/usr/include/c++/9/bits/std_abs.h:48:43: error: expected ';' after top level declarator
/snap/flutter/current/usr/include/c++/9/cstdlib:123:15: error: expected '{'
/snap/flutter/current/usr/include/c++/9/cstdlib:123:15: error: C++ requires a type specifier for all declarations
/snap/flutter/current/usr/include/c++/9/cstdlib:123:35: error: expected expression
/snap/flutter/current/usr/include/c++/9/cstdlib:123:43: error: expected ';' after top level declarator
/snap/flutter/current/usr/include/c++/9/stdlib.h:38:7: error: no member named 'abort' in namespace 'std'; did you mean '::abort'?
/snap/flutter/current/usr/include/c++/9/stdlib.h:39:7: error: no member named 'atexit' in namespace 'std'; did you mean '::atexit'?
fatal error: too many errors emitted, stopping now [-ferror-limit=]
Exception: Build process failed

Btw, I'm on PopOS 22.04. Anyone some ideas? I will also try to install flutter manually and post here if there are the same issues.

@LuFlo
Copy link
Author

LuFlo commented Nov 12, 2022

The manual flutter install works fine, I just had to make sure to delete do a clean rebuild: flutter/flutter#66477

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

1 participant