use g++ instead of gcc following code review.