Do you know why #include file <iostream.h> not found. ?
No cpp environment setup for my profile now.
AIX 5.3
ls -tl cpp*
lrwxrwxrwx 1 bin bin 16 Aug 03 2009 cpp -> /usr/
ccs/lib/cpp
/usr/ccs/lib] ls -tl cpp
-r-xr-xr-x 1 bin bin 900732 Jun 08 2007 cpp
[shkdev2:/usr/ccs/lib]
cat a02.cpp
#include <iostream.h>
int main( int argc, const char* argv[] )
{
}
compile
cpp a02.cpp
"a02.cpp", line 2.10: 1506-296 (S) #include file <iostream.h> not
found.
#line 3 "a02.cpp"
int main( int argc, const char* argv[] )
{
}
Possibly because it is an obsolete header. No recent code should be
using it.
--
Ian Collins
So, Do you know what is replacement for iostream.h ?
Have a look at the C++ FAQ. Your question is answered in
http://www.parashift.com/c++-faq-lite/coding-standards.html#faq-27.4
Try on our machine , Still have error.
cpp a02.cpp
"a02.cpp", line 2.10: 1506-296 (S) #include file <iostream> not found.
#line 3 "a02.cpp"
int main( int argc, const char* argv[] )
{
}
cat a02.cpp
/* cpp a02.cpp -o a02 */
#include <iostream>
int main( int argc, const char* argv[] )
{
}
[shkdev2:/home/ericl6/shell]
Don't make us pull the bits and pieces with pliers.
What error do you get when you compile your second example?
What OS are you using? What compiler?
etc
I think in this case the OP did, in fact, give that information; or at
least enough of it to see what might be wrong.
The error is
"a02.cpp", line 2.10: 1506-296 (S) #include file <iostream> not found
and the "compiler" seems to be "cpp".
To the OP: did you know that, on many systems, cpp is not a C++
compiler but the pre-processor? Did you know that if you want it to
find C++ headers you might have to run it like this:
cpp -x c++
? Did you see if "man cpp" was of any help?
I've worded the above in a vague way because exactly what cpp is and
what arguments it takes varies from system to system. It is simpler
to use the compiler. If you really want to see the PP output, most
compilers have a flag for that (-E in most cases).
--
Ben.
I wouldn't agree.
Something is obviously very wrong on the OP's system, because the
"example" works.
cpp is the c pre processor, not C++ compiler.
scott
Why would it not work? cpp processes the text and gives an error
message since it can't find the C++ header. Is that not what is
happening? Looks that way to me.
--
Ben.
Not sure. Ask OP what he did.
> message since it can't find the C++ header. Is that not what is
> happening? Looks that way to me.
>
Yes. And he obviously did something to break the preprocessor.
What am I missing here? I don't see anything broken. The evidence
is limited but you see something obviously broken and I see the
behaviour I'd expect (well, allowing for differences between cpp
implementations it's what I'd expect).
--
Ben.
Are you kidding? If yes, it is not funny.
Preprocessing this:
#include <iostream>
int main( int argc, const char* argv[] )
{
}
should not produce this:
"a02.cpp", line 2.10: 1506-296 (S) #include file <iostream> not found
unless you did something stupid.
That is not expected behaviour.
No, I'm quite serious. I thought I was misunderstanding you and it
seems I still am.
> Preprocessing this:
> #include <iostream>
> int main( int argc, const char* argv[] )
> {
> }
>
> should not produce this:
> "a02.cpp", line 2.10: 1506-296 (S) #include file <iostream> not found
>
> unless you did something stupid.
You said something was broken. That's what I don't understand. Maybe
we just have a different meaning of "broken" but that seems unlikely
because you also said "something is obviously very wrong on the OP's
system" which is pretty much what I mean by "broken".
Of course the OP "did something stupid" by not telling the
preprocessor what language to use (there may be some other mechanism
in the OP's case because preprocessors vary quite a lot) but that was
covered ages ago in my original reply.
> That is not expected behaviour.
It's exactly what I'd expect. It is the C preprocessor after all that
gets commandeered for other languages. What would you expect?
--
Ben.
This is new to me, as I didn't know you can set the preprocessor for
different languages. I knew the c++ uses c preprocessor, but I never
thought about it.
>> That is not expected behaviour.
>
> It's exactly what I'd expect. It is the C preprocessor after all that
> gets commandeered for other languages. What would you expect?
>
I expected not to get the error.