delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/07/20/00:12:31

From: "A. Sinan Unur" <asu1 AT c-o-r-n-e-l-l DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: HELP please: C++ Not working!!
Date: 20 Jul 2003 03:06:51 GMT
Organization: Cornell University
Lines: 62
Sender: asu1 AT cornell DOT invalid (on pool-129-44-210-20.syr.east.verizon.net)
Message-ID: <Xns93BDEB231C2DBasu1cornelledu@132.236.56.8>
References: <umqjhv4ncr5ni8j45i83dfvlfdhsakt6ib AT 4ax DOT com>
NNTP-Posting-Host: pool-129-44-210-20.syr.east.verizon.net
X-Trace: news01.cit.cornell.edu 1058670411 7821 129.44.210.20 (20 Jul 2003 03:06:51 GMT)
X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu
NNTP-Posting-Date: 20 Jul 2003 03:06:51 GMT
User-Agent: Xnews/5.04.25
X-Face: #0:Oa+WV[,\dU+SJ\X%#!MhGkG;vsj^Tzl1KJHck]V;S8u}yvJ<rd?.0]p2-6jgTf.>p~GpGgD.mLo)IY,&yDRM1dV3z'Y'8D=+Y7k[|[~mGbV(<(8Im%IhZkC9.A.&]TGcwX9GKGgA,lqReCST$aDsGKy#zU~laO|oJiD$e"6&_tzrxT}K,X_e,FC&}P8J"x~ii,lr6)L}=tZI#cNU,7u]J"TLISliDF2pmIKR`ulX=X-sB2aM?f4wIG5Z_nXceH~5}E*t+vx!unlkVJ7]57x`%S1\gR{.1_^Gu2L'am[/=c]'7Hj1l^Yx!nCe40dFkW
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

RadSurfer <RadSurfer AT yahoo DOT com> wrote in 
news:umqjhv4ncr5ni8j45i83dfvlfdhsakt6ib AT 4ax DOT com:

> Please help so I do not loose any sleep over this!
> I'd really like to understand this once and for all ;-)
> 
> My program looks like this:
> 
> [gcc -dumpversion = 3.23]
> 
> /* C++ */
> 
> #include <iostream>
> 
> int main(void) {
> 
>   cout << "Hello World!" << endl;
> 
> }
> 
> invokation:
> 
> h:\djgpp>gcc -x c++ hw.cpp -o hw.exe
> (is this okay?)

Change that to:

#include <iostream>

int main(void) {
    std::cout << "Hello World!" << std::endl;
}

and

gxx -Wall hw.cpp -o hw.exe

> Outcome:
> 
> hw.cpp: In function `int main()':
> hw.cpp:7: `cout' undeclared (first use this function)
> hw.cpp:7: (Each undeclared identifier is reported only once for each
> function it appears in.)
> hw.cpp:7: `endl' undeclared (first use this function)
> 
> WHAT is wrong here?

You need a C++ book that shows standard C++/
 
> I have   \djgpp\lang\cxx\....     as extracted 
> I have \djgpp\lib\gcc-lib\...      etc; as extracted
> and files from both GCC and GPP archives are carefully
> copied over...

What do you mean 'copied over'?

Sinan.
-- 
A. Sinan Unur
asu1 AT c-o-r-n-e-l-l DOT edu
Remove dashes for address
Spam bait: mailto:uce AT ftc DOT gov

- Raw text -


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