[parisc-linux] g++ problem with `std' namespace

Matthew Wilcox willy@debian.org
Fri, 25 Jan 2002 16:30:52 +0000


On Fri, Jan 25, 2002 at 09:54:46AM -0600, Greg Ingram wrote:
> 
> I seem to have run into a problem with GCC on parisc-linux which the
> script below will demonstrate.  I get an "`fread' undeclared in namespace
> `std'" error.  The example works fine on four other architectures, but
> they all have gcc 2.95.x while my parisc box has gcc 3.0.x.  Is this a
> parisc problem, a gcc problem, or a coder problem?

bit of each.  gcc changed to be closer to being standards compliant,
and broke a lot of noncompliant code that had previously worked.
In this case, fread is no longer in std.  You should be using ::fread,
not std::fread

Oh -- just figured out a different solution.  If you replace #include
<stdio.h> with #include <cstdio>, std::fread works.

-- 
Revolutions do not require corporate support.