2014년 4월 26일 토요일

gcc 4.7, g++ 4.7 install on 12.04 LTS

1. Update apt repositories

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update

2. Check

$ sudo apt-cache search "g\+\+"

3. Install

$ sudo apt-get install gcc-4.7 g++-4.7

4. Set as a default gcc

$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7
$ sudo update-alternatives --config gcc
then Select gcc-4.7

5. Confirm

dokyun@redbomb-server:~$ g++ --version
g++ (Ubuntu/Linaro 4.7.3-2ubuntu1~12.04) 4.7.3
Copyright (C) 2012 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.
dokyun@redbomb-server:~$



댓글 없음:

댓글 쓰기