www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/06/03:47:58

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Compile and link C++ program
Date: Wed, 05 Nov 1997 18:51:17 -0800
Organization: Alcyone Systems
Lines: 21
Message-ID: <346130A5.11D1E5D9@alcyone.com>
References: <63qn2c$e86$1 AT news DOT kth DOT se> <6hHAOqqO8gB AT prg DOT hannover DOT sgh-net DOT de>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mark Junker wrote:

> > I get the message "undefined reference to cout".
>
> Try including <stream.h>.

No, then he would have gotten a compiler error, not a linker error.

The problem is that he didn't read the README.1ST file that come with
DJGPP, which states that one must link in the C++ libraries when
compiling C++ programs.  The most straightforward way to do this is to
run gxx (g++ under Unix) instead of gcc, although one can link in the
libraries manually if they so desire.

-- 
         Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
                       Alcyone Systems / http://www.alcyone.com/max/
  San Jose, California, United States / icbm://+37.20.07/-121.53.38
                                     \
   "Since when can wounded eyes see / If we weren't who we were"
                                   / Joi

- Raw text -


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