This program is C++, not C. You can tell based on the line



double mileage_calculator(double &d)


To compile the program with GCC, use the command g++ instead of gcc.
Or even better,...