From: Jens-S. Voeckler (voeckler@ipc1.rrzn.uni-hannover.de)
Date: 12/28/92


From: voeckler@ipc1.rrzn.uni-hannover.de (Jens-S. Voeckler)
Subject: [Q][GCC][G++] Using streams
Date: 28 Dec 1992 13:08:03 GMT

I have encountered a problem when trying to compile a c++ program with
g++. I am using SLS 0.98.5 distribution with the 0.99.0 kernel. Take a
simple program like "asdf.cc":

        # include <stream.h>

        int main(void)
        {
          cout << "Hello world!\n";
          return 0;
        }

At first, I tried to compile using "g++ -o asdf asdf.cc":

        Undefined symbol _cout referenced from text segment
        Undefined symbol operator...

Then I tried "g++ -o asdf asdf.cc -static". That does compile the
program, but yields an executable with the ridiculous size of 75k!

A local guru suggested linking just the libg++ statically instead of
using the "-lxxx" directive. That does not seem to work, either.

Another guru suggested getting the lig++ source and recompiling
everything (I'm not a guru, how am I supposed to do that?). That
does leave me with executables which may not run on other systems.

QUESTIONS

Is there any other option besides "-static"? What do I have to do to
get it translated? Do I miss sym-links? libraries? compiler
directives? Does translating libg++ help? Did anyone do so? Where
would I get it? Will Peter include something in the like of streams
into the next SLS distribution?

Thanx, Jens