Install gcc 4.9 at ubuntu 18.04
Available is: sudo apt install g++-4.8
And the no PIE gcc54-c++_5.4.0-ubuntu16_amd64.deb
https://drive.google.com/file/d/1ptHLaZXImpeMzq4xuuGGn5VjrvxNSop3/view?usp=sharing , Ref. https://stackoverflow.com/questions/50213089/linking-error-with-gcc-g-7-3-0-on-ubuntu-18-04/50232797#50232797 → My answer.
Or add xenial
to /etc/apt/sources.list
temporarily : sudo gedit /etc/apt/sources.list
deb http://dk.archive.ubuntu.com/ubuntu/ xenial main
deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe
... and do sudo apt update && sudo apt install g++-4.9