I'm currently setting up Homebridge to run on my Pi using this installation guide.
I have run into a problem regarding the C++ compiler section; I understand that this part of the guide is out of date as the versions in the instructions to not match the linked guide. However, whilst I have successfully followed the other guide and can now execute gcc-8.1.0 --version to receive:
gcc-8.1.0 (GCC) 8.1.0
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.
When I run either g++ -v or gcc -v I receive the following:
...
gcc version 6.3.0 20170516 (Raspbian 6.3.0-18+rpi1+deb9u1)
This is contrary to the main guide which dictates that both g++ -v and gcc -v should yield the same version as the one installed first (version 8.1.0 not 6.3.0).
Whilst the main guide does indicate that this may be the case by stating that:
Now you have the needed compiler, but it is not yet set to be the default compiler. You can fix that using the instructions here.
In my case I simply did this:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7
This does not help considering the versions do not match.
My question is: Do I need to change both the default g++ and gcc versions considering that g++ and gcc already seem to be preinstalled? If so, what command(s) do I need to issue to do this?
Thank you in advance for your help,
Kind regards, Rocco