[ale] gcc-3.4.2 backwards-incompatibility?

Jason Fritcher jkf at wolfnet.org
Thu Apr 28 20:29:19 EDT 2005


Mills, John M. wrote:
> The module uses:
>  #include <fstream>
>
> The build then fails on the declaration:
>
>   fstream f(PREPROG_FNAME, ios::out);
>
> with the message:
>  "preprogrammed.cc:201: error: `fstream' undeclared (first use this
> function)"

I don't see it mentioned above, so I'll assume the following is the problem. ;)

To be more standards compliant, gcc 3+ enforces namespaces. The standard C++
code like that is all in the std namespace, so you'll either need to include a
'using namespace std' statement near the top, or prefix all the library function
references with std::. I'd go with the former. :)

--
Jason Fritcher
jkf at wolfnet.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature




More information about the Ale mailing list