Code not compiling after setting up a "new" computer

Post Reply
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

Code not compiling after setting up a "new" computer

Post 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?
User avatar
crasbe
Posts: 243
Joined: Mon Jul 08, 2019 5:18 pm
Location: Germany
Has thanked: 44 times
Been thanked: 107 times

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

Post 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.
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 times
Contact:

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

Post 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
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

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

Post 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.
Post Reply