delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/29/23:00:59

From: "The Hustler" <ne1 AT ooo DOT com>
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

get rid of (void) change it to just ()
and after the hello world line
type :
 return 0;
it should look like this:


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