linux-1psk:/gcc/gcc-12.1.0/build # ../configure -enable-checking=release -enable-languages=c,c++-disable-multilib
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install.../usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output.../usr/bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for libphobos support... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking forC compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNUC compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISOC89... none needed
checking for gcc option to accept ISOC99...-std=gnu99
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking forCC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking forFCC... no
checking forKCC... no
checking forRCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNUC++ compiler... no
checking whether g++ accepts -g... no
checking whether g++ accepts -static-libstdc++-static-libgcc... no
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking for gdc... no
checking whether the D compiler works... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with-std=gnu++11... no
checking whether g++ supports C++11 features with-std=gnu++0x... no
checking whether g++ supports C++11 features with-std=c++11... no
checking whether g++ supports C++11 features with+std=c++11... no
checking whether g++ supports C++11 features with-h std=c++11... no
checking whether g++ supports C++11 features with-std=c++0x... no
checking whether g++ supports C++11 features with+std=c++0x... no
checking whether g++ supports C++11 features with-h std=c++0x... no
configure: error:***A compiler with support forC++11 language features is required.
2、解决办法
linux-1psk:/gcc/gcc-12.1.0/build # zypper install install gcc-c++-y
Loading repository data...Reading installed packages...
'install' not found in packagenames.Tryingcapabilities.
No provider of 'install' found.'-y' not found in packagenames.Tryingcapabilities.
No provider of '-y'found.
Resolvingpackagedependencies...The following 3 NEW packages are going tobe installed:
gcc-c++ gcc48-c++ libstdc++48-devel
3new packages toinstall.Overall download size:8.4MiB. Already cached:0B. After the operation, additional 38.1MiB will be used.
Continue?[y/n/...? shows all options](y): y
Retrievingpackagelibstdc++48-devel-4.8.5-31.20.1.x86_64 (1/3),2.8MiB(23.6MiB unpacked)Retrievingpackagegcc48-c++-4.8.5-31.20.1.x86_64 (2/3),5.6MiB(14.5MiB unpacked)Retrievingpackagegcc-c++-4.8-6.189.x86_64 (3/3),4.8KiB(0B unpacked)Checkingfor file conflicts:...........................................................................................................................................................................................[done](1/3)Installing: libstdc++48-devel-4.8.5-31.20.1.x86_64 ...............................................................................................................................................................[done](2/3)Installing: gcc48-c++-4.8.5-31.20.1.x86_64 .......................................................................................................................................................................[done](3/3)Installing: gcc-c++-4.8-6.189.x86_64 .............................................................................................................................................................................[done]