The problem may be related to GCC 7.0 which the newest Ubuntu utilizes. GCC 7 utilizes the latest C++ standards and tends to error or warn on code that would have otherwise compiled regardless of whether it was actually "correct". The are a number of packages which fall victim to this standard change, though you should be able to pass a flag to use C99 by default or a standard between now and 1999.
Hope this helps.