Mail Archives: djgpp/1996/03/17/15:50:55
| Xref: | news2.mv.net comp.os.msdos.djgpp:1919
|
| From: | strider7 AT unm DOT edu
|
| Newsgroups: | comp.os.msdos.djgpp
|
| Subject: | Re: Problem with cout in V2
|
| Date: | Thu, 14 Mar 1996 09:33:32 -0700
|
| Organization: | University of New Mexico, Albuquerque
|
| Lines: | 42
|
| Message-ID: | <31484A5C.6C57@unm.edu>
|
| References: | <4i708c$8as AT news DOT asu DOT edu>
|
| NNTP-Posting-Host: | ppp_030.unm.edu
|
| Mime-Version: | 1.0
|
| 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.
>
> 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
> hal AT suncap DOT com :: deafen AT asu DOT edu :: hagar AT mail DOT hvs DOT com
> My opinions and those of my employer rarely, if ever, coincide.
this question is far too often asked, but you must compile with the
-lgpp option to link the c++ library
- Raw text -