delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/10/10/09:45:04

From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Changing Compile/Link options
Date: 10 Oct 2002 13:21:18 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 54
Message-ID: <ao3use$ofm$1@antares.lu.erisoft.se>
References: <ao3taa$k20$1 AT news DOT stortek DOT com>
NNTP-Posting-Host: lws256.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

MikeC (my DOT address AT end DOT of DOT post) wrote:
: I have recently loaded DJGPP onto a Win2K platform. I use RHIDE, and
: everything is working fine - as long as it stays on my PC!  If I send a
: compiled program to somebody else with Win2K, when they attempt to execute
: the program, a DOS box opens on their screen them immediately closes again -
: and that's it. Show over!

Ask them to open the DOS box themself and start your program in it. Do
they get a crash message in that case?

: A colleague of mine also uses DJGPP, but he doesn't use RHIDE - he uses some
: other editor, then compiles with the line :

: gcc -Wall -O2 -o myprog.exe myprog.c

: and his compiled programs work on other Win2K machines.

When he's compiling the same program as you?

: RHIDE on my machine executes

: gcc -g -c myprog.c -o myprog.o

: then

: gcc -o myprog.exe myprog.o

: I have messed about with the settings for the compile and linker options a
: bit, but I can't make it compile a program that somebody else can use. If I
: come out of RHIDE and execute the line that my colleague uses, of course, it
: works, but what am I doing wrong in RHIDE?

As far as I can see: nothing that should make your programs crash.

-O2 is optimisation level. At least -O should really be used.

-g is debug information.

-Wall turns on "good" (in the eyes of gcc developers) warnings.

The presence or absence of these options should not make any
difference _unless_ you have bugs in your code which goes unnoticed in
one optimisation level but not in another (-O switch). (And usually
those bugs appear when optimisation is cranked _up_, not down.)

: Any help or pointers appreciated.

Add "-O2" to rhide compile options to get the equivalent optimisation
level as your colleague.


Right,

						MartinS

- Raw text -


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