http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61026
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- I think the C++ headers (<sstream>, <vector> and <algorithm>) need to be included before the GCC headers that poison malloc. The actual culprit is <sstream> but there's no guarantee the others don't use malloc.