delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/19/15:59:09

Date: Tue, 19 Oct 1999 20:54:06 +0200
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Message-Id: <199910191854.UAA01054@acp3bf.physik.rwth-aachen.de>
To: djgpp AT delorie DOT com
Subject: Re: Problems compiling and running a program.
Newsgroups: comp.os.msdos.djgpp
Organization: RWTH Aachen, III. physikalisches Institut B
X-Newsreader: TIN [version 1.2 PL2]
Reply-To: djgpp AT delorie DOT com

In article <B45C46D3AF14D3119C560090274F38D424C6BB AT DAEX01> you wrote:
> To Whom It May Concern;

> I purchased the book "Teach Yourself C++ in 24 hours" and so far I am
> understanding
> everything, but I can't seem to compile and run a program; my steps are:

> #1 - Type a program using EDIT.
> #2 - Save the file with a *.CPP extension.
> #3 - run gxx -o hello.cpp hello.exe (from c:\djgpp)

That command line is very wrong. Must be either of the following

	gxx -o hello.exe hello.cpp
	gxx hello.cpp -o hello.exe

The '-o' option means: 'create a program with the following name', so
the name must come immediately after it. For added benefit, you should
probably add other options, to get as many warnings as you can from
gcc: '-O2 -Wall -W', maybe even '-ansi -pedantic'. But then, you'll
probably find that with those settings, none of the samples from that
type of book will get through the compiler: they're just to badly
written.

--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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