www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/09/23/18:10:26

X-Originating-IP: [24.169.88.178]
From: "Timothy M Boronczyk" <bluephoenixbeta AT hotmail DOT com>
To: djgpp AT delorie DOT com
Subject: questions/help with c++ compiling
Date: Mon, 23 Sep 2002 18:10:05 -0400
Mime-Version: 1.0
Message-ID: <F2454wgGLcJqZpiRfRv00003b15@hotmail.com>
X-OriginalArrivalTime: 23 Sep 2002 22:10:05.0418 (UTC) FILETIME=[F898A4A0:01C2634D]
Reply-To: djgpp AT delorie DOT com

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:

#include <iostream.h>
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

I am then greeted with:

In file included from c:/djgpp/lang/cxx-v31/backward/iostream.h:31,
                 from c:/djgpp/new/hello.cpp:1:
c:/djgpp/lang/cxx-v31/backward/backward_warning.h:32:2: warning: #warning 
This file includes at least one deprecated or antiquated header. Please 
consider using one of the 32 headers found in section 17.4.1.2 of the C++ 
standard. Examples include substituting the <X> header for the <X.h> header 
for C++ includes, or <sstream> instead of the deprecated header 
<strstream.h>. To disable this warning use
-Wno-deprecated.

Well, that's all well and good... How I understand it is that iostream.h may 
be old, but still usable.  And there is a hello.exe, so gpp at least did 
something with my code.  Unfortunately, it's some "ungodly size" at 
577,795bytes, and will not execute.  I mearly receive the error message, 
"Program too big to fit in memory" when I attempt to run it.

So here're my quetions:

1) Am I at least using the correct command/syntax to compile a c++ program?

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

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.?

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

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

- Raw text -


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