Mail Archives: djgpp/1996/03/14/19:06:50
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 -