WSL Ubuntu20.04源码编译gcc11.3

https://github.com/gcc-mirror/gcc
下载 tags: 11.3.0

mv /mnt/c/Users/20169/Desktop/gcc-releases-gcc-11.3.0 /home/zs/
unzip gcc-releases-gcc-11.3.0
cd gcc-releases-gcc-11.3.0
./contrib/download_prerequisites

sudo apt install flex
sudo apt install zlib1g-dev
if(
	     sudo apt install libc6-dev-armel-cross
     	 apt install gcc-multilib     ==  安装成功)
     	 //安装位置选择在/usr/local/gcc-11.3.0  默认位置是/usr/bin/gcc
    	./configure --prefix=/usr/local/gcc-11.3.0 --enable-bootstrap --enable-languages=c,c++ --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib
else:
 	 	./configure --prefix=/usr/local/gcc-11.3.0 --enable-bootstrap --enable-languages=c,c++ --enable-threads=posix --enable-checking=release --disable-multilib --with-system-zlib

if( make -j24 == successful):
  		sudo make install
else:
    make clean
    print("GG")
    return

WSL Ubuntu20.04源码编译gcc11.3_第1张图片
WSL Ubuntu20.04源码编译gcc11.3_第2张图片

g++ -std=c++2a -o c20.o c20.cpp
./c20.o

参考
https://blog.51cto.com/oothinking/5565053
https://zhuanlan.zhihu.com/p/373437562
https://blog.csdn.net/weixin_30895603/article/details/99205173

你可能感兴趣的:(C++,linux)