Running flutter app on clear linux

I’m trying to run my flutter app (the most basic one) in CL but I have this error

CMake Error at /usr/share/cmake-3.29/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/jose/WORK/Rental/REAL/APPS/platform_flutter/build/linux/x64/debug/CMakeFiles/CMakeScratch/TryCompile-yUD98m'

    Run Build Command(s): /usr/bin/ninja -v cmTC_e9d16
    [1/2] /usr/bin/clang++   -g -O3 -feliminate-unused-debug-types  -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -Wl,--copy-dt-needed-entries -m64  -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -malign-data=abi -fno-semantic-interposition -ftree-vectorize -ftree-loop-vectorize  -fvisibility-inlines-hidden -MD -MT CMakeFiles/cmTC_e9d16.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_e9d16.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_e9d16.dir/testCXXCompiler.cxx.o -c /home/jose/WORK/Rental/REAL/APPS/platform_flutter/build/linux/x64/debug/CMakeFiles/CMakeScratch/TryCompile-yUD98m/testCXXCompiler.cxx
    FAILED: CMakeFiles/cmTC_e9d16.dir/testCXXCompiler.cxx.o 
    /usr/bin/clang++   -g -O3 -feliminate-unused-debug-types  -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -Wl,--copy-dt-needed-entries -m64  -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -malign-data=abi -fno-semantic-interposition -ftree-vectorize -ftree-loop-vectorize  -fvisibility-inlines-hidden -MD -MT CMakeFiles/cmTC_e9d16.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_e9d16.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_e9d16.dir/testCXXCompiler.cxx.o -c /home/jose/WORK/Rental/REAL/APPS/platform_flutter/build/linux/x64/debug/CMakeFiles/CMakeScratch/TryCompile-yUD98m/testCXXCompiler.cxx
    clang++: error: unknown argument: '-ftree-loop-vectorize'
    clang++: warning: -Wl,--copy-dt-needed-entries: 'linker' input unused [-Wunused-command-line-argument]
    clang++: warning: -Wl,-z: 'linker' input unused [-Wunused-command-line-argument]
    clang++: warning: -Wl,now: 'linker' input unused [-Wunused-command-line-argument]
    clang++: warning: -Wl,-z: 'linker' input unused [-Wunused-command-line-argument]
    clang++: warning: -Wl,relro: 'linker' input unused [-Wunused-command-line-argument]
    clang++: warning: optimization flag '-ftree-loop-distribute-patterns' is not supported [-Wignored-optimization-argument]
    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...                                           
Error: Unable to generate build files

Anyone can help me? Thanks in advance

the default CFLAGS inside /usr/share/defaults/etc/profile doesn’t act nicely with clang. You can try changing them or export CFLAGS in your terminal to override the defaults. Here is a (somewhat flawed) eg: Assistance building Gamescope from source - #3 by Kingfisher

This is my config in this file:

CFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-dist>
FFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z,now >
FCFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z,now>
CXXFLAGS="$CFLAGS -fvisibility-inlines-hidden -Wl,--enable-new-dtags -std=gnu++17"

I change from -std=gnu++17 to -std=gnu++20 but the error is the same.
What value would be appropriate?

Your error message has -ftree-loop-vectorize as an error. Try removing that and see if the error changes
EDIT: you can also remove the ones which say are a warning

To restore the file back to default, use sudo swupd repair