www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/14/19:06:50

Xref: news2.mv.net comp.os.msdos.djgpp:1851
Newsgroups: comp.os.msdos.djgpp
From: rjvdboon AT cs DOT vu DOT nl (Boon van der RJ)
Subject: Re: Problem with cout in V2
Nntp-Posting-Host: kits.cs.vu.nl
References: <4i708c$8as AT news DOT asu DOT edu>
Sender: news AT cs DOT vu DOT nl
Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
Date: Thu, 14 Mar 1996 07:38:11 GMT
Message-ID: <Do8yJn.236.0.-s@cs.vu.nl>
Lines: 43
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

deafen AT imap2 DOT asu DOT edu wrote:
>Skinny:
>OS: Dos 7.0 (Win95)
>DPMI: CWSDPMI
>DJGPP: V2, djdev, gcc 2.7.2, bnu 2.5.2, gpp 2.7.2, libgpp 2.7.1
>Installed to D:\DJGPP

>Code:
>// test.cpp
>#include <iostream.h>

>main()
>{
>  cout << "This is a test.\n";
>  return 0;
>}

>Errors:
>At compile time, this gives undefined reference errors for 'cout' and 
>'ostream::operator<<(char const *)'.

>DJGPP.ENV is properly specified in the environment, and is correct.  cpp 
>properly preprocesses; the error apparently occurs at link time, judghing 
>by the output of gcc -v -o test.exe test.cpp.

     use          gcc -v -o test.exe test.cpp -lgpp
Put the libs to use as the last arguments on the command-line,
and read the FAQ.

>If the character literal is changed to an integer literal (cout << 8;) 
>the second error becomes 'ostream::operator<<(int)'.

>This is apparently a problem with either iostream.h or libgpp.  Am I 
>misusing the cout stream, or does G++ handle iostreams differently than 
>other versions of C++?

>Thanks in advance for any help you can offer.

>--
>Hal Haygood :: PC/Network/Unix technician, Suntek Integrated Technologies
                           ^^^^ gcc on UNIX works the same, or do you use g++

hth Robert.

- Raw text -


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