How to build Asterisk 1.8 on Xenial?

Based on the lead from @steeldriver, I learned that Ubuntu 16.04 has a package in its standard repo for gcc-4.8 and g++-4.8. I installed g++ and a few other packages needed for building Asterisk 1.8:

apt-get install g++-4.8 libcurl4-openssl-dev libncurses5-dev libxml2-dev

This installs g++4.8 as a distinct binary from g++ version 5.3.1, which is also installed. I just need to configure the Asterisk build to use g++4.8, and build:

./configure CXX=g++4.8
make -j4
make install

And eureka! It worked! I built this outdated version of Asterisk 1.8 on Ubuntu 16.04.


As Bill Karwin answered, it's a gcc issue. But I've managed to build Asterisk 1.8 only after adding an extra flag to configure:

./configure CXX=g++-4.8 CC=gcc-4.8

Also note hyphens in the values.

Tags:

G++

Asterisk