Your message dated Tue, 3 Dec 2002 06:59:46 -0500
with message-id <[EMAIL PROTECTED]>
and subject line Bug#171561: g++-3.2: iostream does not work
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 3 Dec 2002 10:16:12 +0000
>From [EMAIL PROTECTED] Tue Dec 03 04:16:11 2002
Return-path: <[EMAIL PROTECTED]>
Received: from pot.cnuce.cnr.it [146.48.83.182] 
        by master.debian.org with esmtp (Exim 3.12 1 (Debian))
        id 18JA67-00014U-00; Tue, 03 Dec 2002 04:16:11 -0600
Received: from pot by pot.cnuce.cnr.it with local (Exim 3.36 #1 (Debian))
        id 18JA64-0003uN-00
        for <[EMAIL PROTECTED]>; Tue, 03 Dec 2002 11:16:08 +0100
From: Francesco Potorti` <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]> 
Subject: g++-3.2: iostream does not work 
X-Debbugs-CC: Francesco Potorti` <[EMAIL PROTECTED]>
Organization: 
X-fingerprint: 4B2 6187 5C3 D6B1 2E31  7666 9DF 2DC9 BE21 6115
Message-Id: <[EMAIL PROTECTED]>
Date: Tue, 03 Dec 2002 11:16:08 +0100
Delivered-To: [EMAIL PROTECTED]
X-Spam-Status: No, hits=-0.1 required=5.0
        tests=SPAM_PHRASE_01_02
        version=2.41
X-Spam-Level: 

Package: g++-3.2
Version: 1:3.2.1-0pre3
Severity: normal

Sorry if this is not a bug, but I cannot find any way why it isn't.  I
cannot make iostream work.  The appended short program compiles (and
works) okay with g++-2.95, but does not compile with either 3.0 or 3.2
(against which this report is sent).  The error messages are:

g++-3.2 bin2a.cc -o bin2a
bin2a.cc: In function `int main(int, char**)':
bin2a.cc:9: `cerr' undeclared (first use this function)
bin2a.cc:9: (Each undeclared identifier is reported only once for each function 
   it appears in.)
bin2a.cc:10: `ifstream' undeclared (first use this function)
bin2a.cc:10: parse error before `(' token
bin2a.cc:12: `f' undeclared (first use this function)
bin2a.cc:13: `cout' undeclared (first use this function)
make: *** [bin2a] Error 1


-- System Information
Debian Release: testing/unstable
Kernel Version: Linux pot.cnuce.cnr.it 2.4.18 #2 Mon Jul 29 12:21:48 CEST 2002 
i686 Pentium II (Deschutes) GenuineIntel GNU/Linux

Versions of the packages g++-3.2 depends on:
ii  gcc-3.2        3.2.1-0pre3    The GNU C compiler.
ii  gcc-3.2-base   3.2.1-0pre3    The GNU Compiler Collection (base package).
ii  libc6          2.2.5-14.3     GNU C Library: Shared libraries and Timezone
ii  libstdc++5-dev 3.2.1-0pre3    The GNU stdc++ library version 3 (developmen

===File /tmp/bin2a.cc=======================================
#include <iostream>
#include <fstream>

// Leggi da file in binario e scrivi su standard input in ascii
int
main (int argc, char *argv[])
{
  if (argc != 2)
    { cerr << "Un argomento richiesto: nome del file di ingresso\n"; exit (1); }
  ifstream f (argv[1], ios::bin|ios::in);
  double x;
  while (f.read(&x, sizeof(x)))
    cout << x << '\n';
  return 0;
}
============================================================

---------------------------------------
Received: (at 171561-done) by bugs.debian.org; 3 Dec 2002 11:59:49 +0000
>From [EMAIL PROTECTED] Tue Dec 03 05:59:49 2002
Return-path: <[EMAIL PROTECTED]>
Received: from ip68-100-128-98.nv.nv.cox.net (mx02.derobert.net) 
[68.100.128.98] 
        by master.debian.org with esmtp (Exim 3.12 1 (Debian))
        id 18JBiP-0007Nq-00; Tue, 03 Dec 2002 05:59:49 -0600
Received: from fermi.vpn.local ([192.168.67.6] helo=suespammers.org)
        by mx02.derobert.net with esmtp (Exim 3.22 #1 (Red Hat Linux))
        id 18JBiO-0005Nd-00; Tue, 03 Dec 2002 06:59:48 -0500
Date: Tue, 3 Dec 2002 06:59:46 -0500
Subject: Re: Bug#171561: g++-3.2: iostream does not work
Content-Type: text/plain; charset=US-ASCII; format=flowed
Mime-Version: 1.0 (Apple Message framework v548)
Cc: Debian Bug Tracking System <[EMAIL PROTECTED]>
To: Francesco Potorti` <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED]
From: Anthony DeRobertis <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
Message-Id: <[EMAIL PROTECTED]>
Content-Transfer-Encoding: 7bit
X-Mailer: Apple Mail (2.548)
Delivered-To: [EMAIL PROTECTED]
X-Spam-Status: No, hits=-6.2 required=5.0
        tests=IN_REP_TO,QUOTED_EMAIL_TEXT,SPAM_PHRASE_01_02,
              USER_AGENT_APPLEMAIL
        version=2.41
X-Spam-Level: 

On Tuesday, December 3, 2002, at 05:16 AM, Francesco Potorti` wrote:
>
> Sorry if this is not a bug, but I cannot find any way why it isn't.

This is due to a rather old change in the C++ standard. I think it was 
between the second and third edition of the Stroustrup book, but I 
could be mistaken.

The C++ standard library lives in the "std" namespace. So you must 
either write:

        std::cerr << "Whatever";

or "using namespace std::cerr" or "using namespace std"

You just saw this because gcc-2.95 did not have proper namespace 
support.


Reply via email to