From: "Jesper Lund" Newsgroups: comp.os.msdos.djgpp References: <20020813142638 DOT 26420 DOT 00000048 AT mb-bd DOT aol DOT com> Subject: Re: newbie help Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Message-ID: Date: Tue, 13 Aug 2002 23:35:10 +0200 NNTP-Posting-Host: 213.237.1.107 X-Complaints-To: news-abuse AT wol DOT dk X-Trace: news010.worldonline.dk 1029274516 213.237.1.107 (Tue, 13 Aug 2002 23:35:16 MET DST) NNTP-Posting-Date: Tue, 13 Aug 2002 23:35:16 MET DST Organization: Customer of Tiscali A/S To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Steveadele" wrote: > #include > > int main() > { > cout << "hello world!\n"; > return 0; > } > that is exactly how the book shows it also but, > when i compile it i get a list of errors; > hello.cpp: inf function 'int main()': > hello.cpp:6: count undeclared (first use this function) > hello.cpp:6: (each undeclared identifier is reported only once > hello.cpp:6: for each function it appears in.) > hello.cpp:6: parse error before ';' > can anyone tell me what im doing wrong? 1) Use #include instead of 2) Are you sure that you didn't misspell 'cout' as 'count' ? 3) If you are using gcc 3.x (check with gcc -v), your code must take into account that cout is in the std namespace (as the C++ standard says). Write std::cout or put a line with 'using namespace std;' after the #include statement.