Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

#include file <iostream.h> not found.

118 views
Skip to first unread message

moonhkt

unread,
Mar 10, 2010, 1:50:31 AM3/10/10
to
Hi All

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[] )
{
}

Ian Collins

unread,
Mar 10, 2010, 1:55:08 AM3/10/10
to
On 03/10/10 07:50 PM, moonhkt wrote:
> Hi All
>
> Do you know why #include file<iostream.h> not found. ?

Possibly because it is an obsolete header. No recent code should be
using it.

--
Ian Collins

moonhkt

unread,
Mar 10, 2010, 4:26:01 AM3/10/10
to

So, Do you know what is replacement for iostream.h ?

Ike Naar

unread,
Mar 10, 2010, 4:36:34 AM3/10/10
to

moonhkt

unread,
Mar 10, 2010, 9:45:24 AM3/10/10
to
On 3月10日, 下午5時36分, i...@localhost.claranet.nl (Ike Naar) wrote:
> In article <aedda404-2ef8-4e07-9afa-0b2547e34...@c34g2000pri.googlegroups.com>,

>
> moonhkt  <moon...@gmail.com> wrote:
> >On 3月10日, 下午2時55分, Ian Collins <ian-n...@hotmail.com> wrote:
> >> On 03/10/10 07:50 PM, moonhkt wrote:
>
> >> > Hi All
>
> >> > Do you know why #include file<iostream.h>  not found. ?
>
> >> 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]

Vladimir Jovic

unread,
Mar 10, 2010, 10:19:14 AM3/10/10
to

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

Ben Bacarisse

unread,
Mar 10, 2010, 10:31:50 AM3/10/10
to
Vladimir Jovic <vlada...@gmail.com> writes:

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.

Vladimir Jovic

unread,
Mar 10, 2010, 11:59:33 AM3/10/10
to
Ben Bacarisse wrote:

> Vladimir Jovic <vlada...@gmail.com> writes:
>
>>>
>>> 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".
>

I wouldn't agree.

Something is obviously very wrong on the OP's system, because the
"example" works.

Scott Lurndal

unread,
Mar 10, 2010, 1:48:07 PM3/10/10
to
moonhkt <moo...@gmail.com> writes:
>On 3=E6=9C=8810=E6=97=A5, =E4=B8=8B=E5=8D=885=E6=99=8236=E5=88=86, i...@loc=
>alhost.claranet.nl (Ike Naar) wrote:
>> In article <aedda404-2ef8-4e07-9afa-0b2547e34...@c34g2000pri.googlegroups=
>.com>,
>>
>> moonhkt =C2=A0<moon...@gmail.com> wrote:
>> >On 3=E6=9C=8810=E6=97=A5, =E4=B8=8B=E5=8D=882=E6=99=8255=E5=88=86, Ian C=

>ollins <ian-n...@hotmail.com> wrote:
>> >> On 03/10/10 07:50 PM, moonhkt wrote:
>>
>> >> > Hi All
>>
>> >> > Do you know why #include file<iostream.h> =C2=A0not found. ?
>>
>> >> Possibly because it is an obsolete header. =C2=A0No 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. =C2=A0Your question is answered in
>>
>> =C2=A0http://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]

cpp is the c pre processor, not C++ compiler.

scott

Ben Bacarisse

unread,
Mar 10, 2010, 4:40:50 PM3/10/10
to
Vladimir Jovic <vlada...@gmail.com> writes:

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.

Vladimir Jovic

unread,
Mar 11, 2010, 6:29:53 AM3/11/10
to

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.

Ben Bacarisse

unread,
Mar 11, 2010, 10:07:33 AM3/11/10
to
Vladimir Jovic <vlada...@gmail.com> writes:

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.

Vladimir Jovic

unread,
Mar 12, 2010, 4:43:29 AM3/12/10
to

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.

Ben Bacarisse

unread,
Mar 12, 2010, 8:10:25 AM3/12/10
to
Vladimir Jovic <vlada...@gmail.com> writes:

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.

Vladimir Jovic

unread,
Mar 15, 2010, 5:09:34 AM3/15/10
to

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.

0 new messages