I am reading an article on raspberry pi on a local magazine and they do this
sudo apr-get install gcc-4.8 g++-4.8
sudo rm -rf /usr/bin/gcc
sudo rm -rf /usr/bin/g++
sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++
I understand that here they are replacing the default gcc and g++ with a recently installed 4.8 version
What version of gcc does the raspberry pi 2 and 3 come with originally?
(The above commands are not required on a rasp pi 1 or zero-- wonder why?)
-
my pi's have gcc/g++ 6.3 (and also gcc 4.9) - so, not sure what to sayJaromanda X– Jaromanda X2017年08月30日 03:10:28 +00:00Commented Aug 30, 2017 at 3:10
-
In raspberrypi.stackexchange.com/questions/12325/… something like this was recommendedKansaiRobot– KansaiRobot2017年08月30日 03:42:15 +00:00Commented Aug 30, 2017 at 3:42
-
3 year old question - 4.8 (or later it seems) is standard version, even in wheezyJaromanda X– Jaromanda X2017年08月30日 03:43:26 +00:00Commented Aug 30, 2017 at 3:43
3 Answers 3
Strictly speaking, Raspberry Pi comes with no software. The gcc version will depend on which distribution of Linux (or other OS) you take and exactly when you take it. Most Linux distribution images periodically update to new versions.
That being said, my Pi running up-to-date Raspian has version
gcc (Raspian 4.9.2-10) 4.9.2
as of this moment (Aug 30, 2017).
The default version of the GCC are as follows:
- Raspbian Stretch: GCC 6.3.0
- Raspbian Jessie: GCC 4.9.2 (GCC 4.8.4 available)
- Raspbian Wheezy: GCC 4.6.3 (GCC 4.4.7 and 4.7.2 available)
g++ always gets the same version number as GCC, since it is part of the same software project.
Dowload the file from here: http://archive.raspbian.org/raspbian/dists/stretch/main/binary-armhf/Packages
and run cat Packages | grep "Package: gcc*"
You should see:
Package: gcc-6