From: "The Hustler" Newsgroups: comp.os.msdos.djgpp Subject: Re: My first steps Date: 30 Aug 1998 02:57:18 GMT Organization: AT&T WorldNet Services Lines: 46 Message-ID: <6saf2e$9p9@bgtnsc03.worldnet.att.net> References: <6-mRyROCZFB AT jerakeen DOT online-club DOT de> NNTP-Posting-Host: 12.69.2.210 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk get rid of (void) change it to just () and after the hello world line type : return 0; it should look like this: #include int main() { cout << "Hello World"; return 0; } Holger Merk wrote in message <6-mRyROCZFB AT jerakeen DOT online-club DOT de>... > Hello All ! > > I've just downloaded DJGPP V2 and installed it on my OS/2-System. But >I'm quite new to C++ and have some problems with compiling the following >program, which works fine with IBM C-Set: > > #include > int main(void) { > cout << "Hello World"; > } > > When compiling it with "gcc hello.cpp -o hello.exe -lm" I get the >following error: > > c:/prg/anw/djgpp/tmp\cccanohi(.text+0x15):hello.cpp: undefined >reference to `cout' > c:/prg/anw/djgpp/tmp\cccanohi(.text+0x1a):hello.cpp: undefined reference to `ostream::operator<<(char const *)' > > If I use "printf" instead of "cout" everything works fine. Is this an DJGPP problem or am I just to stupid to write a simple cpp-program ? > > Holger > >--- >Jerakeen @ gmx.net >Holger Merk @ 2:2443/2011.12 >http://online-club.de/m1/Jerakeen >## CrossPoint v3.11 R ## >