From: Vladimir Jovic on
Ben Bacarisse wrote:
> Vladimir Jovic <vladaspams(a)gmail.com> writes:
>
>> Ben Bacarisse wrote:
>>> Vladimir Jovic <vladaspams(a)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.
>
> Why would it not work? cpp processes the text and gives an error

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.
From: Ben Bacarisse on
Vladimir Jovic <vladaspams(a)gmail.com> writes:

> Ben Bacarisse wrote:
>> Vladimir Jovic <vladaspams(a)gmail.com> writes:
>>
>>> Ben Bacarisse wrote:
>>>> Vladimir Jovic <vladaspams(a)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.
>>
>> Why would it not work? cpp processes the text and gives an error
>
> 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.
From: Vladimir Jovic on
Ben Bacarisse wrote:
> Vladimir Jovic <vladaspams(a)gmail.com> writes:
>
>> Ben Bacarisse wrote:
>>> Vladimir Jovic <vladaspams(a)gmail.com> writes:
>>>
>>>> Ben Bacarisse wrote:
>>>>> Vladimir Jovic <vladaspams(a)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.
>>> Why would it not work? cpp processes the text and gives an error
>> 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).
>

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.
From: Ben Bacarisse on
Vladimir Jovic <vladaspams(a)gmail.com> writes:

> Ben Bacarisse wrote:
>> Vladimir Jovic <vladaspams(a)gmail.com> writes:
>>
>>> Ben Bacarisse wrote:
>>>> Vladimir Jovic <vladaspams(a)gmail.com> writes:
>>>>
>>>>> Ben Bacarisse wrote:
>>>>>> Vladimir Jovic <vladaspams(a)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.
>>>> Why would it not work? cpp processes the text and gives an error
>>> 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).
>>
>
> Are you kidding? If yes, it is not funny.

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.
From: Vladimir Jovic on
Ben Bacarisse wrote:
> Vladimir Jovic <vladaspams(a)gmail.com> writes:
>> 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.
>

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.