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

Greg Ingram ingram@symsys.com
Fri, 25 Jan 2002 09:54:46 -0600 (CST)


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?

Regards,

- Greg


#!/bin/sh
cat >foo.cc <<EOF
#include <stdio.h>

class FOO
{
public:
  FOO(void);
  int read(char *, int);

  FILE *fd;
};

FOO::FOO(void)
{
  fd = stdin;
}

int FOO::read(char *buf, int size)
{
  return std::fread(buf, size, 1, fd);
}
      
int main(int argc, char **argv)
{
  FOO foo;
  char buf[512];

  foo.read(buf, 512);

  return 0;
}
EOF
g++ foo.cc