delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/11/10/21:28:38

From: sjm AT mso DOT anu DOT edu DOT au (Stephen Meatheringham)
Subject: a C++ problem
10 Nov 1996 21:28:38 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199611102149.IAA15315.cygnus.gnu-win32@maestro.anu.edu.au>
Original-To: gnu-win32 AT cygnus DOT com
X-Sun-Charset: US-ASCII
Original-Sender: owner-gnu-win32 AT cygnus DOT com

I have just installed the beta-16 binaries on my Pentium PC.
However, compiling and linking the following trivial program :

#include <iostream.h>
main()
{
int i = 10;
cout << i << endl;
}

using : g++ -o fran.exe fran.cc -I/cygnus/include/g++

generates the following :

(fran.exe 1003) In cygwin_except_handler
(fran.exe 1003) Exception trapped!
(fran.exe 1003) exception C0000005 at 10032606
(fran.exe 1003) exception: ax 8B08558B bx 477004 cx 20 dx 8F0804
(fran.exe 1003) exception: si 476F68 di 100016A3 bp 6AF708 sp 6AF6FC
(fran.exe 1003) exception is: STATUS_ACCESS_VIOLATION
(fran.exe 1003) Stack trace:
(fran.exe 1003) frame 0: sp = 0x6AF514, pc = 0x10002A68
(fran.exe 1003) frame 1: sp = 0x6AF530, pc = 0xBFF7663C
(fran.exe 1003) frame 2: sp = 0x6AF554, pc = 0xBFF859D9
(fran.exe 1003) frame 3: sp = 0x6AF5EC, pc = 0xFFECBAD7
(fran.exe 1003) frame 4: sp = 0x6AF708, pc = 0x410411
(fran.exe 1003) frame 5: sp = 0x6AF714, pc = 0x10001F32
(fran.exe 1003) frame 6: sp = 0x6AF720, pc = 0x10001F66
(fran.exe 1003) frame 7: sp = 0x6AF728, pc = 0x401020
(fran.exe 1003) frame 8: sp = 0x6AF738, pc = 0x10001EBB
(fran.exe 1003) frame 9: sp = 0x6AFE14, pc = 0x10001ECF
(fran.exe 1003) frame 10: sp = 0x6AFE20, pc = 0x41287C
(fran.exe 1003) frame 11: sp = 0x6AFE30, pc = 0x401012
(fran.exe 1003) frame 12: sp = 0x6AFE38, pc = 0xBFF88F75
(fran.exe 1003) frame 13: sp = 0x6AFF78, pc = 0xBFF88E23
(fran.exe 1003) frame 14: sp = 0x6AFFF4, pc = 0xBFF8783F
(fran.exe 1003) frame 15: sp = 0x815600CC, pc = 0x5
(fran.exe 1003) End of stack trace (more stack frames may be present)

If I use printf() instead of the C++ output it works fine.

Can anyone please tell me where I'm going wrong.
I've looked in the FAQ and also this mailing list archive (which would be nice if
it were searchable) but can find no pointers.

Many thanks in advance

				Stephen Meatheringham
				Mt. Stromlo Observatory
				Private Bag, Weston Creek P.O.
				ACT 2611, AUSTRALIA
				phone : +61 6 2490293
				email : sjm AT mso DOT anu DOT edu DOT au
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019