From: Axel V. <vol...@ib...> - 2001-03-22 10:47:15
|
Dear all, couple of days ago I sent the source of a program which produces a segmentation fault within the cygwin-environment in connection with mingw(quoted in this message). Thank you all for your answers! They helped, because indeed, the segmenta= tion fault does not occur while using a pure mingw-environment. But all my stu= ff is related to cygwin. So I would like to keep this system. Weeks ago I got my mingw from ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygwin/gcc-2.95.2/gcc-2.95= .2-mingw-extra.tar.gz. Apparently, Mumit created an easy-to-use package for cygwin with mingw-ve= rsion 0.3.=20 Finaly, my question: How can I create/get/produce this package with mingw-version 0.5? Again, thank you very much in advance and best regards Axel >Following code using mingw produces a segmentation fault: > test.cpp: > =3D=3D=3D=3D=3D=3D=3D=3D=3D > #include<iostream> > #include<fstream> > #include<string> > using namespace std; > int main(void) > { > fstream file; > file.open( "testfile.txt" ,ios::in | ios::nocreate); > if (!file.good()) return 0; > string token; > file>>token; //THIS LINB PRODUCES THE SEGMENTATION FAULT > file.close(); > return 1; > } > with testfile.txt: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > a_string > or_something_else > I am using g++ 2.95.2-6 from www.cygwin.com and mingw 0.3. > Compile command is: g++ -I. -L. -mno-cygwin test.cpp > (Where '.' contains all related files for mingw) _______________________________________________________________________ Axel Volkwein Tel: +41 1 63 33562 / / / Institute of Structural Engineering Fax: +41 1 63 31044 /__ /__ ETH H=F6nggerberg - HIL E22.3 www.ibk.baug.ethz.ch / / / /\ CH-8093 Z=FCrich vol...@ib... / /__/ / \ |