undefined reference to `cout'

Jim Wilson wilson@cygnus.com
Thu Apr 2 11:32:00 GMT 1998


	I've compiled and built egcs1.0.2 on a RedHat 5.0 system running 2.0.31.  When
	I try and build a cpp program, I get the following link error:

	/tmp/cca281661.o: In function `main':
	/tmp/cca281661.o(.text+0x9): undefined reference to `cout'

There is perhaps something wrong with the gcc command you typed, or there is
perhaps something wrong with the way you installed egcs.  It isn't possible
to tell from the info you provided.

If you typed `gcc', then you might try typing `g++' instead.  This will
automatically link with the libstdc++ library (-lstdc++) which contains cout.

Jim



More information about the Gcc mailing list