fstream, egcs, and seg faults
David B. Rees
dbr@spoke.nols.com
Mon Mar 15 18:19:00 GMT 1999
This may be offtopic, but I'm hoping someone here has come across this problem
before and has a solution. I searched the last two months of egcs archives with
no luck.
The following two programs will segfault on my Linux machine:
#include <fstream.h>
void main(void)
{
ifstream *IS;
IS = new ifstream("test.cpp");
}
#include <fstream.h>
void main(void)
{
ifstream IS;
char line[256];
IS.open("test.cpp");
IS.getline(line, 255);
}
I came across this problem while trying to compile VTK on my machine. I
searched dejanews for similar reports, and came across a few people who had.
Here's the versions of software I'm running:
spoke:~> g++ -v
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
glibc2.1, Binutils 2.9.1.0.21, kernel 2.2.3
glibc hasn't been recompiled with a glibc2.1 compiled compiler.
Any ideas? Should I attempt recompiling glibc2.1?
Thanks,
Dave
More information about the Gcc
mailing list