Mail Archives: djgpp/2001/03/22/21:48:28
At 05:15 PM 03/22/2001 -0600, you wrote:
>Short and simple; here's the code. At compile time, I get the error at the
>bottom. I posted this at comp.lang.c++ for help, and everyone compiled it
>just fine. So I'm gonna guess it's a DJGPP thing. Perhaps I have an outdated
>version of the compiler's STL or something (my copy of DJGPP was downloaded
>from the official homepage less than a year ago though). This is an example
>program from "The C++ Standard Library" by Nicolai Josuttis (p. 603), if you
>care.
[ snip ]
> try
> {
> sum = MyLib::ReadAndProcessSum(cin);
> }
> catch (const ios::failure& error) // <=====
>error right here
> {
> cerr << "I/O exception: " << error.what() << endl;
> return EXIT_FAILURE;
> }
[ snip ]
> .... that one doesn't. Any help? Thanks.
>Compiling: Summain.cpp
>In function `int main()':
>Summain.cpp (20) Error: parse error before `&'
>Summain.cpp (24) Error: confused by earlier errors; bailing out
>There were some errors
Perhaps the following excerpt from streambuf.h can explain:
[ streambuf.h ]
...
the executable file might be covered by the GNU General Public License. */
#ifndef _STREAMBUF_H
#define _STREAMBUF_H
#ifdef __GNUG__
#pragma interface
#endif
/* #define _G_IO_THROW */ /* Not implemented: ios::failure */
#define _IO_NEW_STREAMS // new optimizated stream representation
extern "C" {
#include <libio.h>
}
//#include <_G_config.h>
#ifdef _G_NEED_STDARG_H
#include <stdarg.h>
#endif
#ifndef _IO_va_list
#define _IO_va_list char *
#endif
...
#ifdef _IO_THROW
void _throw_failure() const { throw new ios::failure(this); }
#else
void _throw_failure() const { }
#endif
...
[ streambuf.h ]
Try grepping for IO_FAILURE in /dev/env/DJDIR/lang/cxx and you'll see the
reason why ios::failure fails to compile.
HTH. Bye.
nimrod_a_abing
--------------
+========================================+
| Home page: www.geocities.com/n_abing |
+========================================+
"Tinimbang ka ngunit kulang."
If you understand that phrase, i-email mo'ko. ;-)
- Raw text -