delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/12/02:01:31

Date: Mon, 12 Jun 1995 08:21:16 +0300
From: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
To: djgpp AT sun DOT soe DOT clarkson DOT edu, mbandy AT superdec DOT uni DOT uiuc DOT edu
Subject: Re: problem with djgpp

> 	This is in fact in the FAQ.  You can do three things:
>
>	go32 x
>	reaname go32.exe to x.exe
>	or, copy /b go32.exe+x x.exe and then just run x.  This is I sassume
> what aout2exe does.

No, this isn't in the FAQ.  *This* is:

 
9.1   Q: I compile my program, but can't run the file built by the linker.
      A: DOS doesn't know how to run unix-style COFF files which GNU
         linker produces.  That's what the extender is for.  To run a COFF
         file called myprog, type
 
                      go32 myprog args...
 
         Alternatively, you can produce an .exe file by running coff2exe:
 
                      coff2exe myprog
 
         This appends a short (if you can call 27 KB program ``short'')
         real-mode stub to your program, which will call go32.exe
         automatically.  Then you can run your program as any other DOS
         program.
 
9.2   Q: I compile my program, but when I run the .exe it hangs.
      A: Most likely, you did this: "gcc foo.c -o foo.exe".  This doesn't
         create a real .EXE file.  That's like renaming your phone
         directory file to an .EXE and expecting it to run.  You must use
         the COFF2EXE program to convert the output of gcc to a real
         executable:
 
                      coff2exe foo
 
         This produces foo.exe you can run like any other DOS program.
 
9.3   Q: The binaries I get with the distribution are .exe files, but gcc
         creates files with no extension.  I rename the files gcc produces
         to .EXE's, but they don't work.
      A: To get an .EXE from an COFF, you must *prepend* either go32.exe
         or stub.exe to the file.  A program called "coff2exe" is provided
         to do this.  Just run "coff2exe myprog".

9.13  Q: When I copy my DJGPP application program to another PC where no
         DJGPP is installed, I can't run it.  It complains that it cannot
         exec go32.  Do I really need all your multi-megabyte installation
         to run compiled programs?
      A: No, you don't.  You can either (1) copy go32.exe to the target
         machine and put it somewhere along the PATH there, or (2) merge
         go32.exe with your program to produce a stand-alone executable
         (albeit one which is larger by about 70KB) with this command:
 
              coff2exe -s c:\djgpp\bin\go32.exe yourprog
 
         (Replace c:\djgpp\bin with the actual path to go32.exe on your
         system.)

- Raw text -


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