delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/29/10:45:27

From: Jerakeen AT ONLINE-CLUB DOT de (Holger Merk)
Newsgroups: comp.os.msdos.djgpp
Subject: My first steps
Date: 29 Aug 1998 16:39:00 +0100
Organization: RP-Online-Services
Lines: 28
Message-ID: <6-mRyROCZFB@jerakeen.online-club.de>
Reply-To: Jerakeen AT gmx DOT net
NNTP-Posting-Host: as6-pri10.rp-plus.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

  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 <iostream.h>
        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 ##

- Raw text -


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