X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: Date: Wed, 16 Jul 2008 13:01:09 -0300 From: "Matias Bonaventura" To: cygwin AT cygwin DOT com Subject: help with iofstream - Exception: STATUS_ACCESS_VIOLATION when writing or reading MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m6GG1fap017617 Hi, I´m trying to compile and run an application. It´s currently compiling fine, but as soon as I run it I get the below error. Debbugging the code I manage to find it was failing when trying to manipulate (read/write) a file. I reduce the error and create a simple test case which outputs the same error: [(!) DEBUG. Before opening the file] [(!) DEBUG. Before writing into the file] 57 [main] test 5664 _cygtls::handle_exceptions: Exception: STATUS_ACCESS_VIOLATION 766 [main] test 5664 open_stackdumpfile: Dumping stack trace to test.exe.stackdump The test case code I´m using: int main() { cout << "[(!) DEBUG. Before opening the file]" << endl; ofstream file; file.open(FILE_NAME, ios::out); if (file.is_open() && file.good() ){ cout << "[(!) DEBUG. Before writing into the file]" << endl; file << "hola archivo"; cout << "[(!) DEBUG. After writeing into the file]" << endl; file.close(); } return 0; } Any idea why this could be happening? Is it a problem with my cygwin instalation, with the compiler....? I´m using gcc-2.95. I didn´t try with newer versions because the application I´m trying to compile targets that compiler and won´t work the newer. THANKS! -- :-) M.A.T.I.A.S. :-) -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/