Page 1 of 1

Code not compiling after setting up a "new" computer

Posted: Sun Dec 03, 2023 7:02 pm
by Kelju
Hello,

I am trying to get the development environment running on another computer.
Followed the instruction and executed the following commands on the terminal:

Code: Select all

sudo apt-get install git gcc-arm-none-eabi
Installation goes through with no errors.

When trying to make I get the following error:

Code: Select all

arm-none-eabi-g++: error: unrecognized command line option '-std=c++17'
I checked the compiler version on the old computer and the new one and both are the same:

Code: Select all

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Any idea why I am getting this error and how to fix it?

Re: Code not compiling after setting up a "new" computer

Posted: Sun Dec 03, 2023 10:15 pm
by crasbe
Your gcc version is too old as you are using quite an old version of Ubuntu (16.04, 7 years old by now :D ).

You can find a guide to update the gcc compiler here: https://askubuntu.com/questions/1243252 ... ocal-fossa

Unfortunately it is a bit (a lot) annoying.

Re: Code not compiling after setting up a "new" computer

Posted: Tue Dec 05, 2023 2:52 am
by johu
You could also edit CPPFLAGS in makefile to std=c++11 (I think, or was it 12?) try it. Don't think we're using any of the newer features

Re: Code not compiling after setting up a "new" computer

Posted: Tue Dec 05, 2023 9:48 pm
by Kelju
Hi,

Thank you both crasbe and johu. Both resolutions work.

The reason why I ran into this problem was because I am lazy...
I am running the Linux on a Windows environment inside a Virtual Box.
When changing the PC, I did not want to go through all the trouble of installing a whole new Ubuntu on the Vmachine, so I opted to just make export/import. As crasbe pointed out, the installation was badly outdated. On this note, I now made a fresh installation with the most recent Ubuntu. Works perfecty fine after setting up everything.

Also tried the instruction from Johu with the old Ubuntu installation and the problem was fixed.