When I try to compile my Flutter project it throws this error. This issue started occurring recently. Not sure what package I'm missing. If someone has solved this issue help me out. Currently testing the build in web but it doesn't work as well.
[ +62 ms] Skipping pub get: version match.
[ +131 ms] Generating /home/kartik/Downloads/test_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +71 ms] Launching lib/main.dart on Linux in release mode...
[ +18 ms] Building Linux application...
[ +3 ms] executing: [build/linux/x64/release/] cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DFLUTTER_TARGET_PLATFORM=linux-x64 /home/kartik/Downloads/test_app/linux
[ +598 ms] -- The CXX compiler identification is Clang 18.1.3
[ +39 ms] -- Detecting CXX compiler ABI info
[ +89 ms] -- Detecting CXX compiler ABI info - failed
[ ] -- Check for working CXX compiler: /usr/bin/clang++
[ +85 ms] -- Check for working CXX compiler: /usr/bin/clang++ - broken
[ ] CMake Error at /usr/share/cmake-3.28/Modules/CMakeTestCXXCompiler.cmake:60 (message):
[ +1 ms] The C++ compiler
[ ] "/usr/bin/clang++"
[ ] is not able to compile a simple test program.
[ ] It fails with the following output:
[ ] Change Dir: '/home/kartik/Downloads/test_app/build/linux/x64/release/CMakeFiles/CMakeScratch/TryCompile-01a5qZ'
[ ] Run Build Command(s): /usr/bin/ninja -v cmTC_37378
[ ] [1/2] /usr/bin/clang++ -MD -MT CMakeFiles/cmTC_37378.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_37378.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_37378.dir/testCXXCompiler.cxx.o -c
/home/kartik/Downloads/test_app/build/linux/x64/release/CMakeFiles/CMakeScratch/TryCompile-01a5qZ/testCXXCompiler.cxx
[ +2 ms] [2/2] : && /usr/bin/clang++ CMakeFiles/cmTC_37378.dir/testCXXCompiler.cxx.o -o cmTC_37378 && :
[ ] FAILED: cmTC_37378
[ ] : && /usr/bin/clang++ CMakeFiles/cmTC_37378.dir/testCXXCompiler.cxx.o -o cmTC_37378 && :
[ ] /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)
[ ] -- Configuring incomplete, errors occurred!
[ +12 ms] Building Linux application... (completed in 828ms)
[ ] Error: Unable to generate build files
#0 throwToolExit (package:flutter_tools/src/base/common.dart:34:3)
#1 _runCmake (package:flutter_tools/src/linux/build_linux.dart:185:5)
<asynchronous suspension>
sudo apt-get install libstdc++-14-devSeems like people here have problem if someone shares answers which worked from them. What a drag