How to install gcc8 using devtoolset-8-gcc

前端 未结 3 2242
走了就别回头了
走了就别回头了 2021-02-15 11:01

I am using CentOS Linux release 7.3.1611 which has gcc 4.8.5 20150623 installed. I am looking for a way to install a newer version of gcc, specially 8.1. I found the following

3条回答
  •  暖寄归人
    2021-02-15 11:57

    The follows worked in centos/rhel 7.

    • How to install it?
    # rpm -ivh http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm
    # yum install devtoolset-8
    

    Here is the rpm from http://mirror.centos.org/centos/7/extras/x86_64/Packages/ that might be needed to be updated accordingly.

    • How to use it?
    $ scl enable devtoolset-8 bash
    $ gcc --version
    gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
    Copyright (C) 2018 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    

    The flags -std=c++17 -lstdc++fs and the following line could be helpful.

    #include 
    

提交回复
热议问题