The problem was::
tmp/ccmy4nbs.o: In function main:
tmp/ccmy4nbs.o: Undefined reference to 'cout'
tmp/ccmy4nbs.o: Undefined reference to 'stream::operator(char const*)'
Markus Kossmann sent the answer.
gcc ist the frontend of the C-Compiler. So it doesn't link the C++
standard library ( which contains cout) automatically and you will
need to add a -lstdc++ to link with that library.
> > Trying to learn C++. I can compile a simple program with c++
> > but not gcc.
> Well, what error did you get? It's a little hard to offer assistance
> when you haven't told us what's wrong.
> __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
> / \ Love is the triumph of imagination over intelligence.
> \__/ H.L. Mencken
> Physics reference / http://www.alcyone.com/max/reference/physics/
> A physics reference.