X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: "Fausto Arinos de A. Barbuto" Newsgroups: comp.os.msdos.djgpp Subject: Re: Hello, World! == 753 KB Date: Thu, 21 Feb 2002 21:19:32 -0800 Lines: 47 Message-ID: References: NNTP-Posting-Host: 192.70.176.201 X-Trace: fu-berlin.de 1014352086 4475310 192.70.176.201 (16 [76871]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "A. Sinan Unur" wrote in message: > > That's what I get when I compile the code below with > > "gpp -o hello.exe hello.cpp" (gcc version 3.0.3). > this is a faq so i suggest you check it. You're right. I apologize for that. > > //---------CUT HERE--------- > > #include > ^^^ You should use the new style headers so that the compiler > catch your errors: Where could I read about those new style headers? > C:\DOCUME~1\asu1\LOCALS~1\Temp>gpp t.cc -o t.exe -Wall -O2 > t.cc: In function `int main()': > t.cc:6: `cout' undeclared (first use this function) > t.cc:6: (Each undeclared identifier is reported only once for each > function it appears in.) I compiled the program exactly as you indicated above and got no error/warning messages. An executable was generated and it worked as intended (that is, displaying the "Hello, World!" message). > you will need a using std::cout; to make your code work. No, I don't. The program works anyway. > > #include > > similarly, use . The math.h header was included in the code by mistake. It shouldn't be there. Thanks for the hint anyway! And thanks for taking the time to reply to my note. ---Fausto