gcc invokes the c compiler by default.
g++ invokes the c++ compiler.

So you have to type "g++ <source>" and not "gcc <source>" .

Also the ANSI C++ Standard says it should be #include <iostream> without .h