www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/05/01:32:52

Date: Wed, 5 Jun 1996 08:25:54 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Alix Martin <100726 DOT 473 AT compuserve DOT com>
Cc: djgpp AT delorie DOT com
Subject: Re: problem : unspecified exception at run time
In-Reply-To: <31B45DE2.E68@compuserve.com>
Message-Id: <Pine.SUN.3.91.960605080722.25305D-100000@is>
Mime-Version: 1.0

On Tue, 4 Jun 1996, Alix Martin wrote:

> I unpacked everything ok. Then I wrote a Hello, World program and 
> compiled it. Fine. But when I run it the MS-DOS window crashes and
> I get the following message :
> 
> Program aborted - illegal operation
> If the program persists, look at Win95 help...
> The program encountered an unspecified exception.
> Error location : 1EF3:0158
> Active interrupts : none.
[snip] 
> gcc -v output :
> gcc -v -o hello.exe hello.c

In DJGPP v1.x, you cannot make gcc generate a .exe program that DOS can
run.  The output of the last command line above is a COFF file that DOS
doesn't understand.  When you try to run it, DOS doesn't find its familiar
"MZ" signature as the first 2 bytes, so it treats that file as a .com file
by default, with the obvious results.  What you need to do is this: 

	gcc -o hello hello.c
	coff2exe hello

The last line prepends a small DOS program to `hello' and creates 
`hello.exe' which is now in a DOS .exe format.

Please download the DJGPP FAQ list (faq102.zip from the same place you 
get DJGPP) and search it for solutions whenever you have any problem.  
The problem you reported is explained there in sections 9.1 and 9.2.

- Raw text -


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