Mail Archives: djgpp/2003/01/28/08:45:08
"Hans-Bernhard Broeker" wrote...
> Y Chen <yc12 AT uow DOT edu DOT au> wrote:
>
> > #include <iostream>
> > #include <cstdlib>
> > //#include <fstream>
> > using namespace std;
>
> > //#include <stdlib.h>
> > #include <stdio.h>
> > //#include <iostream.h>
>
> > #include <iomanip.h>
> > #include <new.h> // for memory error handling
>
> This is a horrible mess. You're mixing new-style C++ standard headers
> (without .h) and old-style ones (with .h). And on top of all that,
> you throw C headers into the mix. While this may still work, if
> you're lucky, it's a rather certain path to confusion. Please try to
> avoid that.
This is a criticism of the quagmire that has become the C++ standard
(template) library. IMHO unless you are determined to wade through the
nightmare of i/o streams and its inpenetrable templates then you are better
off with C standard FILE's and printf/scanf.
>
> > #include "LSTM.h"
>
> The last time you posted this, you were reminded that it's quite
> impossible for anybody to help you if you don't cut your problem down
> so you can post a reproducible example. You didn't do that: we still
> cannot know what is in that "LSTM.h" of yours.
>
> You're just annoying people, this way. Please stop it.
It's quite simple, the first problem is in TLSTM::LoadPar()
pFile->scan("NbPredictNextIn:");
pFile is an fstream* declared in TIOBase, as such it doesn't have a scan
method; you'll need to implement this.
The second error (LSTM1.cpp:45: using typedef-name `std::iostream' after
`class') is easily resolved by removing the word class from the call to
WriteWeightStream.
IMHO it's impenetrable error messages like these that should be a warning to
all that using STL streams can be an extremely unpleasant and protracted
business. Caveat emptor, or in English, naff ;-)
-- Lawrence Rust, Software Systems, www.softsystem.co.uk
The problem with Windows XP: http://www.arachnoid.com/boycott
- Raw text -