delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/08/09:19:45

Date: Tue, 8 Jun 1999 11:37:46 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Martin Berard <shf AT videotron DOT ca>
cc: djgpp AT delorie DOT com
Subject: Re: Compiling CGI script under DJGPP
In-Reply-To: <e0J63.2287$zn6.36970@weber.videotron.net>
Message-ID: <Pine.SUN.3.91.990608113727.4197H-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 7 Jun 1999, Martin Berard wrote:

> 1.  When I compile with the following:
>         gcc -o myscript.cgi myscript.c
>     two files are generated:
>         myscript.cgi and myscript.exe  (different size !? the .exe is bigger)

This is expected behavior.  When you say "gcc -o something" and the
`something' stuff does NOT have a .exe extension, GCC produces two
files: one is named "something", the other "something.exe" (any
existing extensions are removed from `something' before appending
.exe).  This is so Unix Makefile's that don't use the .exe extension
still work, since Make will find the file it thinks it produced.

The different size is because the .exe file has a small DOS program
(called "the stub loader") prepended to it.  This small program is
needed because DOS and Windows don't know how to run DJGPP-style
executables, so the stub does it for them.

>     The .exe seems to be runnable not the CGI (Bad command or file name)

Also normal behavior, which is the other half of the reason why two
files are produced.  COMMAND.COM refuses to run a program if its name
doesn't end with ".exe".

> 2.  When I start my script with my broswer it ask me if I want to download
> it..

AFAIK, the CGI programs must be native Win32 executables, otherwise
the Windows Internet software won't cooperate with them.  Complain to
Bill Gates...

- Raw text -


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