From: "Daniel Mironowicz" To: Subject: Re: My first steps Date: Sat, 29 Aug 1998 18:09:37 +0200 Message-ID: <01bdd367$6bd2a0e0$LocalHost@default> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Precedence: bulk This happens because you forgot to link your program with C++ library. Try this: "gcc hello.cpp -o hello.exe -lm -lstdcxx" Holger wrote: > 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 ## > >