From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28800 invoked by alias); 17 Jul 2002 18:40:07 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 28693 invoked from network); 17 Jul 2002 18:40:01 -0000 Received: from unknown (HELO mail-out2.apple.com) (17.254.0.51) by sources.redhat.com with SMTP; 17 Jul 2002 18:40:01 -0000 Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out2.apple.com (8.11.3/8.11.3) with ESMTP id g6HIe0A22091; Wed, 17 Jul 2002 11:40:00 -0700 (PDT) Received: from scv3.apple.com (scv3.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id ; Wed, 17 Jul 2002 11:39:15 -0700 Received: from isolde.apple.com (isolde.apple.com [17.201.24.249]) by scv3.apple.com (8.11.3/8.11.3) with ESMTP id g6HIdrT13706; Wed, 17 Jul 2002 11:39:53 -0700 (PDT) Date: Wed, 17 Jul 2002 11:40:00 -0000 Subject: Re: STL with gcc3 Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v536) Cc: gcc-help@gcc.gnu.org, gcc@gcc.gnu.org To: Ji Li From: Matt Austern In-Reply-To: Message-Id: <953DCC54-99B4-11D6-A92C-00039390D9E0@apple.com> Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg00167.txt.bz2 On Wednesday, July 17, 2002, at 11:35 AM, Ji Li wrote: > > Hello, > > I am experiencing some problem with STL when compile with gcc3. I > have a little piece of c++ code like this: > > #include > #include > > int main(){ > string aa = "Hello World !"; > > cerr << aa << endl; > } > > If I compile it with gcc-2.96, there is no problem. However, when > I compile it with gcc-3.0.4, the compiler does not recognize neither > 'string' nor 'cerr'. But if I add 'using namespace std;', gcc-3.0.4 > works > fine with it. > > I believe there must be a way to make gcc-3.0.4 backward > compatable but just could find it. Would you please point the way for > me? You really don't want to do that. The standard says that everything in the Standard Library is supposed to be in namespace std. Other compilers have conformed to the standard for years. You should change your code, for portability if for no other reason. --Matt