Solaris 11.4: ‘to_string’ is not a member of ‘std’ compiler error

when I compile on Sun Solaris11.4, the following error is reported, What do I do to solve it?
thank you!

Compiler Information:

CMake 3.22.0, Copyright 2000-2021 Kitware, Inc. and Contributors
C compiler on this system is: gcc -std=gnu11
C++ compiler on this system is: g++ -std=gnu++1y
Makefile processor on this system is: gmake
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has <ext/stdio_filebuf.h>

Error information:
/usr/local/cmake-3.22.0/Source/cmCommandArgumentParserHelper.cxx:103:14: error: ‘to_string’ is not a member of ‘std’
line = std::to_string(this->FileLine);
^
gmake: *** [cmCommandArgumentParserHelper.o] エラー 1

/usr/local/cmake-3.22.0/Source/cmFileCommand.cxx:3436:24: error: ‘stoi’ is not a member of ‘std’
compressionLevel = std::stoi(parsedArgs.CompressionLevel);

Hmm. We do have nightly tests running on Solaris. What version of CMake are you using to build CMake itself? Though this looks like bootstrap output.

Cc: @brad.king

The output shown is from the bootstrap script, and it is picking a GNU compiler. What version of the GNU compiler are you using?

Please see the following Info,thank you!
root@solaris:/opt# uname -a
SunOS solaris 5.11 11.3 i86pc i386 i86pc
root@solaris:/opt# gcc --version
gcc (GCC) 4.8.2

I think gcc 4.8 is too old, at least on Solaris. Our nightly testing of building CMake itself on Solaris is done with Oracle Studio 12.6 and with GNU 5.5.

Today, I installed GCC7.1 and can use cmade, thank you very much!