[comp.lang.c++] C++ library

ping@cubmol.BIO.COLUMBIA.EDU (Shiping Zhang) (08/13/89)

Recently I read the book "The C++ Programming Language"
by Bjarne Stroustrup and decided to write something in C++.
But when I tried the first example in the book as below,

#include <stream.h>

main()
{
    cout << "hello,world\n";
}

I even could not compile it. I got the following message:

ld: Undefined symbol 
   _cout 
   __filebuf_underflow 
   __streambuf_underflow 
   __filebuf_overflow 
   __streambuf_overflow 
   __ostream__lshiftFPC__ 
   __circbuf_overflow 
   __circbuf_underflow 

When I looked at the content of libC.a using ar, the output is
the following:

rw-r--r--116/20    202 Aug  8 10:28 1989 __.SYMDEF
rw-r--r--  0/10     60 Feb 22 14:28 1988 _ctor..o
rw-r--r--  0/10    119 Feb 22 14:28 1988 _delete..o
rw-r--r--  0/10     60 Feb 22 14:28 1988 _dtor..o
rw-r--r--  0/10    151 Feb 22 14:28 1988 _handler..o
rw-r--r--  0/10    139 Feb 22 14:28 1988 _main..o
rw-r--r--  0/10    192 Feb 22 14:28 1988 _new..o
rw-r--r--  0/10    334 Feb 22 14:28 1988 _vec..o
rw-r--r--  0/10    191 Feb 22 14:28 1988 dtors..o
rw-r--r--  0/10    182 Feb 22 14:28 1988 exit..o

Actully I can not compile any program with a class in it.
The machine I am working with is a sun2 run under an unix system,
SunOS release 4.0.
The compiler CC is actually a shell file which calls other
two commands, produces C source files, and then calls cc to
compile the new C files together with the library libC.a.

Can anyone tell me what the problem is?

If someone likes to answer my question, please send me the answer
through e-mail. I don't read comp.lang.c++ regularly. Thanks.

-ping
ping@cubmol.bio.columbia.EDU