/usr/bin/ld: cannot find -lstdc++: No such file or directory

when I compile llvm, there is an error. The instruction are:

cmake -G Ninja ../llvm  -DLLVM_PARALLEL_COMPILE_JOBS=7 -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_BUILD_EXAMPLES=ON -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_CCACHE_BUILD=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_ENABLE_PROJECTS='clang;lldb;lld;mlir;clang-tools-extra;compiler-rt' -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_LLD=ON

The error is: /usr/bin/ld: cannot find -lstdc++: No such file or directory

But i have installed libstdc++.

Help me!!!

My guess is that clang is failing to pick up the expected gcc toolchain. You can check with clang -v for which order it’s looking in. If that’s the issue then you’ll likely want to add gcc-install-dir=/path/to/gcc to your CMAKE_C[XX]_FLAGS Clang command line argument reference — Clang 19.0.0git documentation. If that’s not the issue then it’s likely just your environment is not set up correctly.

Thank you for your help. you are right. My clang version is not suit.