delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/09/23/19:33:00

Message-Id: <5.1.1.6.0.20020923181520.00be2b48@imss.gob.mx>
X-Sender: jlsgarrido AT mail DOT SoftHome DOT net (Unverified)
X-Mailer: QUALCOMM Windows Eudora Version 5.1.1
Date: Mon, 23 Sep 2002 18:32:32 -0500
To: djgpp AT delorie DOT com
From: "J. L." <jlsgarrido AT SoftHome DOT net>
Subject: Re: questions/help with c++ compiling
In-Reply-To: <F2454wgGLcJqZpiRfRv00003b15@hotmail.com>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

At 06:10 p.m. 23/09/2002 -0400, you wrote:
>Hello everyone.  I'm sure this will be the first of many questions as I 
>embark upon my programming adventure :)
>
>Okay. Here's my scenario:
>
>As I said in my recent hello letter, I took a few programming classes in 
>high school so I hope to pick up the syntax and commands rather quickly.
>I've been reading through the Programming in C++ tutoral at 
>http://www.cprogramming.com/tutorial.html.  Lesson one gives the example:

This tutorial is outdated. Consider get a recent (and decent) C++ book 
:)  Maybe

http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html


>#include <iostream.h>

This is deprecated. Better use

#include <iostream>
use namespace std;

>int main()
>{
>  cout<<"HEY, you, I'm alive!  Oh, and Hello World!";
>  return 0;
>}
>
>After having entered the preceeding code and having saved it as hello.cpp, 
>I wish to compile it.  Refering to the online users' guide at 
>http://www.delorie.com/djgpp/doc/ug/basics/compiling.html, I enter:
>
>gcc hello.c -o hello.exe

Are you coding C++ or C? For C++ files, use .cpp extension, and type at 
command line.

gpp hello.cpp -o hello.exe

[snip]

>I mearly receive the error message, "Program too big to fit in memory" 
>when I attempt to run it.

Maybe your system needs to be configurated. See FAQ sec. 3.9 at

http://www.delorie.com/djgpp/v2faq/faq3_9.html


>So here're my quetions:
>
>1) Am I at least using the correct command/syntax to compile a c++ program?

No.


>2) It's obviously done something with hello.cpp, but what exactly did gpp 
>do, and what then is the hello.exe file?

Do you use gpp?


>3) If I were to use a "non-depreciated" header, like gpp suggests, which 
>is the iostream.h equivelant... and does the new .h still use the 
>functions cout, cin, etc.?

See above.


>I want to say thanks for your help in advance.  I admit to being a 
>"newbie," but hey, we've all got to start out somewhere, and with brain 
>like a sponge, I'm eager and willing to learn.  :)
>
>-Tim

You're  welcome.

Regards
J. L.

- Raw text -


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