you're compiling in C++ mode. use .c, not .cpp or .c++, and use gcc, not g++.