[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: g++ problem



On 2/8/06, Thomas H. George <lists@tomgeorge.info> wrote:
> As a occasional programmer I tried to recompile an old program I
> intended to expand.  Although #include <iostream> was entered before the
> start of main the g++ compiler did not recognize cin and cout.  This
> seems so elementary  it certainly shouldn't have changed and it
> certainly worked before as I am using the makefile I created when I
> first wrote and compiled the program.  I am running the dist-upgrade
> version of Sarge.  Is there a problem with the current release?  Or am I
> hopelessly out of date?

Try std::cin and std::cout.  The more recent GNU compilers enforce the
std namespace.  I think that started with the 3.X series.  You'll also
need to use std::endl instead of just endl.

--
Michael A. Marsh
http://www.umiacs.umd.edu/~mmarsh
http://mamarsh.blogspot.com



Reply to: