본문 바로가기
개발/Linux

CentOS7 GCC 7.x 설치하기 devtoolset-7

by lucidmaj7 2020. 4. 7.
728x90
반응형

CentOS7 GCC 7.x 설치하기

CentOS 7에서 GCC를 설치하면 4.8.5버전이 설치 됩니다. 때에 따라서 그 이상 버전을 설치 해야할 수도 있습니다.

다음은 GCC, G++ 7.x버전을 설치하는 방법입니다.

$ sudo yum install centos-release-scl
$ sudo yum update scl-utils
$ sudo yum install devtoolset-7

설치가 끝나면 아래 명령어로 gcc 7을 활성화 합니다. 아래 명령어는 gcc 6을 사용할 때마다 실행해야 합니다.

$ scl enable devtoolset-7 bash

GCC명령어를 통해 설치된 버전을 확인 할 수 있습니다.

[root@localhost ~]# gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 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.


[root@localhost ~]# g++ --version
g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 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.


728x90
반응형

댓글