delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/18/19:02:02

From: Golden Hawk <goldenhawk AT mail DOT globalserve DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Duh
Date: Thu, 18 Feb 1999 18:24:55 -0500
Organization: Globalserve Communications Inc.
Lines: 25
Message-ID: <36CCA146.8BCD8720@mail.globalserve.net>
NNTP-Posting-Host: dialin726.toronto.globalserve.net
Mime-Version: 1.0
X-Trace: whisper.globalserve.net 919380806 11525 209.90.132.217 (18 Feb 1999 23:33:26 GMT)
X-Complaints-To: abuse AT globalserve DOT net
NNTP-Posting-Date: 18 Feb 1999 23:33:26 GMT
X-Mailer: Mozilla 4.5 [en] (Win98; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I'm new at this stuff, I'm reading "Teach yourself C++ in 21 days" and I
tried this program:

---
#include <iostream.h>

int main()
{
        cout << "Hello World!\n";
        return 0;
}
---

And when I try to compile I get:

---
c:/progra~1/djgpp/tmp\cccyxeej(.text+0x19):test.cpp: undefined reference
to `cout'
c:/progra~1/djgpp/tmp\cccyxeej(.text+0x1e):test.cpp: undefined reference
to `ostream::operator<<(char const *)'
---

Anyone know why?  I tried doing it a different way with <stdio.h> and
printf, and that worked... so I'm confused....

- Raw text -


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