Mail Archives: djgpp/1996/06/05/01:32:52
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 -