I'm helping (!?) my wife learn C, and she's stumbled over a missing
include file, #include <iostream>.
She's working from the terminal, and has Xcode 2 installed. It's gcc
4.0, and the include file is there:
homeboy% gcc --version
powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 20041026 (Apple Computer,
Inc. build 4061)
homeboy% find /usr/include -name iostream
/usr/include/gcc/darwin/3.3/c++/iostream
/usr/include/gcc/darwin/4.0/c++/iostream
The error msg is
homeboy% gcc peapods.c
peapods.c:1:20: error: iostream: No such file or directory
If I'm so bold as to include the path to iostream the world blows up:
homeboy% gcc -I/usr/include/gcc/darwin/4.0/c++/ peapods.c
In file included from peapods.c:1:
/usr/include/gcc/darwin/4.0/c++/iostream:44:28: error:
bits/c++config.h: No such file or directory
In file included from /usr/include/gcc/darwin/4.0/c++/ios:44,
from /usr/include/gcc/darwin/4.0/c++/ostream:45,
from /usr/include/gcc/darwin/4.0/c++/iostream:45,
from peapods.c:1:
/usr/include/gcc/darwin/4.0/c++/iosfwd:46:29: error: bits/c++locale.h:
No such file or directory
/usr/include/gcc/darwin/4.0/c++/iosfwd:47:25: error: bits/c++io.h: No
such file or directory...
and 4000+ more lines of err msgs.
An Xcode Command Line C++ project compiles and runs fine with her code.
What's up here?
TIA.

Signature
Vince Heuring To email, remove the Vince.
John Whorfin - 29 Dec 2005 22:20 GMT
> I'm helping (!?) my wife learn C, and she's stumbled over a missing
> include file, #include <iostream>.
iostream is a C++ header.
> homeboy% gcc peapods.c
If peapods.c is supposed to be C then you can't use iostreams.
If it is C++ then it should have a C++ extension of which there
are a number. I prefer ".cpp" but ".cxx" is common. Then to
compile it use "g++" in place of "gcc".
Vince Heuring - 30 Dec 2005 00:35 GMT
> > I'm helping (!?) my wife learn C, and she's stumbled over a missing
> > include file, #include <iostream>.
[quoted text clipped - 7 lines]
> are a number. I prefer ".cpp" but ".cxx" is common. Then to
> compile it use "g++" in place of "gcc".
ARRGGHH. Thanks.

Signature
Vince Heuring To email, remove the Vince.
Jalapeno - 29 Dec 2005 22:21 GMT
> I'm helping (!?) my wife learn C, and she's stumbled over a missing
> include file, #include <iostream>.
>
> <snip>
> An Xcode Command Line C++ project compiles and runs fine with her code.
>
> What's up here?
Perhaps C is not C++ ?