www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/05/17:04:09

From: Pat <francis AT megsinet DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: C++ undefined referance error
Date: Thu, 05 Feb 1998 15:47:13 -0600
Organization: Mine not yours
Lines: 19
Message-ID: <34DA3361.EBDD575@megsinet.net>
NNTP-Posting-Host: 209.81.150.74
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello, could someone please tell me why djgpp won't compile this code?

#include <iostream.h>
int main()
{
    cout << "hello world";
    return 0;
}

    I've been compiling C programs for a while now with no problems, but
when I went to try c++ I got two errors:
". . . .ex1.cpp:  undefined reference to 'cout'" and
". . . .undefined reference to 'ostream::operator<<(char const *)'"

I downloaded the c++ libraries again and the c++ executable and made
sure to end my file with *.cpp.  Also, I checked the faq but I couldn't
find anything about this.  As I said before, it worked fine compiling c
programs.  Thanks, Pat

- Raw text -


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