This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: iostream header missing?


Musi we Sat, Jun 2000 nenguva dza 03:13:23PM +0000, Lionel Pinkhard akati:

> I'm not sure, but I think it should be <iostream.h> not <iostream>.

Absolutely correct. I appended `.h' to iostream and I get a clean
compilation with:

	g++ t.cpp -o t

However, I get the following error messages with `gcc t.cpp -o t'

	/home/gerald/tmp/cca202551.o: In function `main':
	/home/gerald/tmp/cca202551.o(.text+0x5): undefined reference to
	`endl(ostream &)'
	/home/gerald/tmp/cca202551.o(.text+0xf): undefined reference to `cout'
	/home/gerald/tmp/cca202551.o(.text+0x14): undefined reference to
	`ostream::operator<<(char const *)'
	/home/gerald/tmp/cca202551.o(.text+0x1f): undefined reference to
	`ostream::operator<<(ostream &(*)(ostream &))'
	g

It looks like I do not understand the difference between gcc and
g++. I would be happy if someone could clarify on this issue.

> > We obtained the following output:
> > 
> > 	 make[2]: Entering directory `/home/j/root/octave-2.1.30/liboctave'
> > 	 c++ -c  -I. -I.. -I../liboctave -I../src -I../libcruft/misc  -
> > 	 I../glob -I../glob -DHAVE_CONFIG_H -mieee-fp -fno-rtti -fno-implicit-
> > 	 templates -g -O2 -Wall Bounds.cc -o Bounds.o
> > 	 Bounds.cc:31: iostream: No such file or directory
> > 	 In file included from Bounds.cc:33:
> > 	 Bounds.h:30: iostream: No such file or directory
> > 	 make[2]: *** [Bounds.o] Error 1
> > 

As shown above output it looks like the sourcecode is compiled
using c++. Is there a difference between g++ and c++?

I have also noticed that the file being referred above as
`Bounds.cc' contains the following as line no. 31:

	#include <iostream>

instead of 

	#include <iostream.h>

Does this mean that I should change the former to latter manually
in all the files containing the former? Or maybe there is a better
way to do it than mess around with the source code?

-- 
Gerald Marewo gerald@aardvark.uz.ac.zw | Directing CCs of followups on Usenet:
"Mail-Copies-To: nobody"  if you do not want any CCs of followups    | update
"Mail-Copies-To: address" to direct CCs of followups to some address | 980724
"Mail-Copies-To: poster"  to direct CCs of followups to the address in "From:"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]