Clang 19 fails with CMake on Tumbleweed

I installed clang19 (19.1.7-3.1). Running CMake uising clang and clang++ I get:

CMake Error at /usr/share/cmake/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/gino/sensorium-2.0/support/build/debug/CMakeFiles/CMakeScratch/TryCompile-irhhcH'

Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_8ff25/fast
/usr/bin/gmake  -f CMakeFiles/cmTC_8ff25.dir/build.make CMakeFiles/cmTC_8ff25.dir/build
gmake[1]: Entering directory '/home/gino/sensorium-2.0/support/build/debug/CMakeFiles/CMakeScratch/TryCompile-irhhcH'
Building CXX object CMakeFiles/cmTC_8ff25.dir/testCXXCompiler.cxx.o
/usr/bin/clang++    -MD -MT CMakeFiles/cmTC_8ff25.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_8ff25.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_8ff25.dir/testCXXCompiler.cxx.o -c /home/gino/sensorium-2.0/support/build/debug/CMakeFiles/CMakeScratch/TryCompile-irhhcH/testCXXCompiler.cxx
Linking CXX executable cmTC_8ff25
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8ff25.dir/link.txt --verbose=1
/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)
/usr/bin/clang++ CMakeFiles/cmTC_8ff25.dir/testCXXCompiler.cxx.o -o cmTC_8ff25
gmake[1]: *** [CMakeFiles/cmTC_8ff25.dir/build.make:103: cmTC_8ff25] Error 1
gmake[1]: Leaving directory '/home/gino/sensorium-2.0/support/build/debug/CMakeFiles/CMakeScratch/TryCompile-irhhcH'
gmake: *** [Makefile:134: cmTC_8ff25/fast] Error 2

Apparently, the wrong libstdc++ is bering used. Which one should I install, and why is it not installed as a dependency for clang19?

Thanks for any help!

Is it installed?

libstdc++ is installed. Gcc is compiling. Apparently, clang19 is using a different libstdc++ than gcc.

gcc is C compiler, not C++.

GCC is Gnu Compiler Collection and includes a C++ compiler since 1987.

Deep dive into the issue: I’m using all latest version of gcc and clang:
gcc and accompanying libstdc++6 version 14.2.1
Clang version 19.1.7
C++ code compiles and links fine with g++

I ran into this recently

Even though gcc 14 is the system default tumbleweed already ships 15, so clang selects that one

clang++ --verbose
clang version 19.1.7
Target: x86_64-suse-linux
Thread model: posix
InstalledDir: /usr/bin
System configuration file directory: /etc/clang
User configuration file directory: /home/rad/.config/clang
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/14
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/15
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/15
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda, version 

make sure you have the corresponding libstdc++ installed

Thanks! Installing libstc++6 for gcc15 fixes the issue.