Root6 compilation on Centos7, g++17 on RooFitCore

Hello, @pedromendes!

Here Building ROOT from source - ROOT it is said that

Also note that compatibility with compilers shipped with devtoolsets on CentOS or Red Hat is not guaranteed.

Also look here Devtoolset/gcc-toolset compatibility

So I on CentOS 7.9 got same error messages and had to build devtoolset components from source on my own, and also their prerequisites, because Centos 7 repos are outdated. It was very long and tedious process with many errors but I finally was able to compile ROOT 6.26 on my machine.
Probably that’s bad way because it is hard to maintain and update. Moreover, now I need to handle with LDCONFIG and other build options so my applications are built with proper gcc version and linked against proper libraries.
So, sadly, my experience with coping with this problem is hardly reproducible and I can only advise you to change Linux distro or build ROOT inside Docker container.

I hope my answer would be useful for you.