错误:*** 需要支持 C++11 语言功能的编译器

错误:*** 需要支持 C++11 语言功能的编译器

我想在 Ubuntu 20.04 上从源代码构建 GCC 11。我在为 ROS 制作软件包时遇到了一些问题,因此我决定更新我的 GNU。我的 gcc 和 g++ 版本是 11.1.0

当我提取下载的 gcc 版本并尝试配置它时

../gcc-releases-gcc-11.1.0/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-11.1.0 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-11.1

我遇到以下错误:

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... no
checking for mawk... mawk
checking for libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for libhsail-rt support... yes
checking for libphobos support... yes
checking for x86_64-linux-gnu-gcc... x86_64-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C 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 GNU C compiler... yes
checking whether x86_64-linux-gnu-gcc accepts -g... yes
checking for x86_64-linux-gnu-gcc option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... no
checking whether /usr/bin/gcc-11.1.0 accepts -g... no
checking whether g++ accepts -static-libstdc++ -static-libgcc... no
checking for x86_64-linux-gnu-gnatbind... no
checking for gnatbind... no
checking for x86_64-linux-gnu-gnatmake... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking whether /usr/bin/gcc-11.1.0 supports C++11 features by default... no
checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=gnu++11... no
checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=gnu++0x... no
checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=c++11... no
checking whether /usr/bin/gcc-11.1.0 supports C++11 features with +std=c++11... no
checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -h std=c++11... no
checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=c++0x... no
checking whether /usr/bin/gcc-11.1.0 supports C++11 features with +std=c++0x... no
checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -h std=c++0x... no
configure: error: *** A compiler with support for C++11 language features is required.

我搜索了很多但无法解决。您有什么建议吗?

谢谢

相关内容