From bug-octave-request at bevo dot che dot wisc dot edu Thu Apr 11 14:56:13 2002 Subject: load-save.cc compilation error From: "John W. Eaton" To: "Albert F. Niessner" Cc: bug-octave at bevo dot che dot wisc dot edu Date: Thu, 11 Apr 2002 14:56:06 -0500 On 11-Apr-2002, Albert F. Niessner wrote: | The load-save.cc is not compiling (no previous errors were encountered). | There are two problems with load-save.cc. | | First, the function 'set()' is undeclared and line 1062 is the first | instance of its use. What is set() supposed to do and where is it | supposed to come from? | | Second, because of the changes in streams in 3.0.4, it looks like | extending istream/ostream is no longer possible or at least much more | difficult. Here is what the errors look like: | | load-save.cc: In constructor `hdf5_fstreambase::hdf5_fstreambase(const | char*, | int, int)': | load-save.cc:1062: `set' undeclared (first use this function) Please try the following patch. Thanks, jwe 2002-04-11 John W. Eaton * load-save.cc (hdf5_ofstream::hdf5_ofstream): Explicitly List std::ostream(0) in constructor. (hdf5_ifstream::hdf5_ifstream): Explicitly List std::istream(0) in constructor. (hdf5_fstreambase::hdf5_fstreambase): Use std::ios::setstate, not set. (hdf5_fstreambase::close): Likewise. (hdf5_fstreambase::open): Likewise. Index: load-save.cc =================================================================== RCS file: /usr/local/cvsroot/octave/src/load-save.cc,v retrieving revision 1.138 diff -u -r1.138 load-save.cc --- load-save.cc 10 Apr 2002 19:18:39 -0000 1.138 +++ load-save.cc 11 Apr 2002 19:49:48 -0000 at @ -1059,7 +1059,7 @@ file_id = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (file_id < 0) - set (std::ios::badbit); + std::ios::setstate (std::ios::badbit); current_item = 0; } at @ -1069,7 +1069,7 @@ if (file_id >= 0) { if (H5Fclose (file_id) < 0) - set (std::ios::badbit); + std::ios::setstate (std::ios::badbit); file_id = -1; } } at @ -1084,7 +1084,7 @@ file_id = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (file_id < 0) - set (std::ios::badbit); + std::ios::setstate (std::ios::badbit); current_item = 0; } at @ -1097,10 +1097,10 @@ { public: - hdf5_ifstream () : hdf5_fstreambase () { } + hdf5_ifstream () : hdf5_fstreambase (), std::istream (0) { } hdf5_ifstream (const char *name, int mode = std::ios::in, int prot = 0) - : hdf5_fstreambase (name, mode, prot) { } + : hdf5_fstreambase (name, mode, prot), std::istream (0) { } void open (const char *name, int mode = std::ios::in, int prot = 0) { hdf5_fstreambase::open (name, mode, prot); } at @ -1110,10 +1110,10 @@ { public: - hdf5_ofstream () : hdf5_fstreambase () { } + hdf5_ofstream () : hdf5_fstreambase (), std::ostream (0) { } hdf5_ofstream (const char *name, int mode = std::ios::out, int prot = 0) - : hdf5_fstreambase (name, mode, prot) { } + : hdf5_fstreambase (name, mode, prot), std::ostream (0) { } void open (const char *name, int mode = std::ios::out, int prot = 0) { hdf5_fstreambase::open (name, mode, prot); } ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------