I think this might answer your question:
Preventing KDS from wanting to build main.c instead of main.cpp?
See my answer in that thread
--Mike
I'm not sure, but are you trying to compile a .c file in C++ mode?
Maybe this is what you are looking for:
Compiling C Files with GNU ARM G++ | MCU on Eclipse
I hope this helps,
Erich