iostream error.

P

Prasad

Hi All,

I am executing simple hello world program. But, getting compile time
errors.
What is the problem here?

prasad@D-T11673A:~/programs/c> cat bst.cpp
#include<iostream>

using namespace std;

int main ()
{
cout << "Hello World." ;
return 0 ;
}

prasad@D-T11673A:~/programs/c> gcc bst.cpp
/tmp/ccrmoRpD.o: In function `main':
bst.cpp:(.text+0x25): undefined reference to `std::cout'
bst.cpp:(.text+0x2a): undefined reference to `std::basic_ostream<char,
std::char_traits said:
(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccrmoRpD.o: In function `__tcf_0':
bst.cpp:(.text+0x47): undefined reference to
`std::ios_base::Init::~Init()'
/tmp/ccrmoRpD.o: In function
`__static_initialization_and_destruction_0(int, int)':
bst.cpp:(.text+0x74): undefined reference to
`std::ios_base::Init::Init()'
/tmp/ccrmoRpD.o:(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status

prasad@D-T11673A:~/programs/c> echo $?
1

Thanks & regards,
Prasad
 
N

Neroku

Prasad ha escrito:
Hi All,

I am executing simple hello world program. But, getting compile time
errors.
What is the problem here?

prasad@D-T11673A:~/programs/c> cat bst.cpp
#include<iostream>

It should be #include <iostream.h>, that's why your compiler doesn't
find the iostream header.


using namespace std;

int main ()
{
cout << "Hello World." ;
return 0 ;
}

All this belongs to C++ and not Standard C, bear in mind that we only
discuss the Standard C so this is off-topic here. Asking to
comp.lang.c++ would be more suitable.
 
I

Ian Collins

Neroku said:
Prasad ha escrito:




It should be #include <iostream.h>, that's why your compiler doesn't
find the iostream header.
No he shouldn't said:
All this belongs to C++ and not Standard C, bear in mind that we only
discuss the Standard C so this is off-topic here. Asking to
comp.lang.c++ would be more suitable.
Followups set.
 
P

Prasad

Thanks a lot, for your suggestions.

I will discuss the issue with c++ Newsgroup.

Sorry for bothering you.

Thanks again
 
M

Martin Ambuhl

Prasad said:
Hi All,

I am executing simple hello world program. But, getting compile time
errors.
What is the problem here?

prasad@D-T11673A:~/programs/c> cat bst.cpp
#include<iostream>
using namespace std;

'What is the problem' is that you are not writing C. The above two
lines are gibberish is C; they appear to be from an arcane bloated
language called "C++", which has its own newsgroup <news:comp.lang.c++>.
 
M

Martin Ambuhl

Neroku said:
Prasad ha escrito:




It should be #include <iostream.h>, that's why your compiler doesn't
find the iostream header.

a) There are no headers named <iostream> or <iostream.h> in C. Your
advice is off-topic and
b) your advice is *wrong*. The completely off-topic C++ header is, in
fact, named <iostream>.

You seem capable of understanding either that <is not
for other languages or that there is an actual standard for that other
language, which your bogus advice contradicts.
 
I

Ian Collins

Martin said:
a) There are no headers named <iostream> or <iostream.h> in C. Your
advice is off-topic and
b) your advice is *wrong*. The completely off-topic C++ header is, in
fact, named <iostream>.

You seem capable of understanding either that <is not
for other languages or that there is an actual standard for that other
language, which your bogus advice contradicts.

This invective is both superfluous and contains the word 'capable' where
you probably wanted 'incapable'. See, I'm not the only one who makes
mistakes.
 
M

Martin Ambuhl

Ian said:
This invective is both superfluous and contains the word 'capable' where
you probably wanted 'incapable'. See, I'm not the only one who makes
mistakes.

You are right that I erred in using 'capable' with the 'either .. or'
constructuction and should have, as you suggest, used 'incapable' or, as
I had intended, used a 'neither .. nor' contstruction. But I was not
passing on bogus, off-topice 'advice'. It is not superfluous for me to
note that your 'advice' was not only off-topic but *wrong*. For God's
sake, if you want to post off-topic answers, at least be close to being
right.
 
I

Ian Collins

Martin said:
You are right that I erred in using 'capable' with the 'either .. or'
constructuction and should have, as you suggest, used 'incapable' or, as
I had intended, used a 'neither .. nor' contstruction. But I was not
passing on bogus, off-topice 'advice'. It is not superfluous for me to
note that your 'advice' was not only off-topic but *wrong*. For God's
sake, if you want to post off-topic answers, at least be close to being
right.

Look agian.

My comments where

"No he shouldn't, the correct file is <iostream>"

and the setting of a follow-up to c.l.c++

So I had already corrected the bogus advice and directed the thread to
the appropriate place.

If you are going to slag someone of on a public forum, get your facts
straight, or you will make an arse of yourself.
 
M

Martin Ambuhl

Ian said:
Look agian.

My comments where

"No he shouldn't, the correct file is <iostream>"

and the setting of a follow-up to c.l.c++

So I had already corrected the bogus advice and directed the thread to
the appropriate place.

That explains it. You are an idiot who does not understand how usenet
works.
If you are going to slag someone of on a public forum, get your facts
straight, or you will make an arse of yourself.

Sorry, I had never imagined that you were a complete idiot. That
someone else has in parallel answered a question never calls for
insulting them by calling their posts "superfluous." Only an idiot with
no understanding of newsgroups would think his post made any others that
he saw "superfluous." Please get a clue.
 
K

Keith Thompson

Martin Ambuhl said:
That explains it. You are an idiot who does not understand how usenet
works.

Martin, you accused Ian Collins of offering bogus advice. In fact, he
*corrected* the bogus advice that someone else had offered, and you
have not acknowledged your own error. Whatever else Ian may have
done, I suggest that there's more than enough blame to go around here.
 
D

David Resnick

Keith said:
Martin, you accused Ian Collins of offering bogus advice. In fact, he
*corrected* the bogus advice that someone else had offered, and you
have not acknowledged your own error. Whatever else Ian may have
done, I suggest that there's more than enough blame to go around here.

Looks to me like Martin's first reply was to Neroku. Ian thought it
was to him and took offense. Apparently you also thought it was to
Ian? I can't see how, the stuff Martin quoted was from Neroku's post.

-David
 
M

Martin Ambuhl

Keith said:
Martin, you accused Ian Collins of offering bogus advice. In fact, he
*corrected* the bogus advice that someone else had offered, and you
have not acknowledged your own error. Whatever else Ian may have
done, I suggest that there's more than enough blame to go around here.

Thank you, Keith. My erro was in supposing that Ian Collins, in calling
my post "superfluous" was somehow involved in the same thread. His
(which he only quoted in this latest message) was a parallel post. It
did not appear as anything to which I responded or as a parent of
anything to which I responded. He gave no reason for asserting that my
response was "superfluous". The text he quoted above appears in no post
to which I responded, or in any parent of such a post. There is no
particular reason for me to acknowledge any error than assuming that he
had any clue about how usenet works. His completely rude and
unwarranted assertion that my post was "superfluous" with no indication
of why shows him to be an ignorant boor. There is no reason for me to
chase down his parallel posting to determine why he decided to belittle
mine.
 
K

Keith Thompson

Martin Ambuhl said:
Thank you, Keith. My erro was in supposing that Ian Collins, in
calling my post "superfluous" was somehow involved in the same thread.
His (which he only quoted in this latest message) was a parallel post.
It did not appear as anything to which I responded or as a parent of
anything to which I responded. He gave no reason for asserting that
my response was "superfluous". The text he quoted above appears in no
post to which I responded, or in any parent of such a post. There is
no particular reason for me to acknowledge any error than assuming
that he had any clue about how usenet works. His completely rude and
unwarranted assertion that my post was "superfluous" with no
indication of why shows him to be an ignorant boor. There is no
reason for me to chase down his parallel posting to determine why he
decided to belittle mine.

In a post that was a direct followup to a post by Ian Collins, you wrote:

| It is not superfluous for me to note that your 'advice' was not only
| off-topic but *wrong*. For God's sake, if you want to post
| off-topic answers, at least be close to being right.

It's reasonable to assume that you were addressing Ian directly,
particularly since the person who actually did offer the bogus advice
was neither mentioned nor quoted in your followup. Usenet posts by
their nature are directed to everyone who reads them, but usually a
second-person pronoun refers to the author of the immediate parent
post, unless someone else is specifically indicated.

If the words "you" and "your" were not intended to refer to Ian,
that's understandable, but it wasn't at all clear from the context.
 
C

CBFalconer

Keith said:
.... snip ...

Martin, you accused Ian Collins of offering bogus advice. In
fact, he *corrected* the bogus advice that someone else had
offered, and you have not acknowledged your own error. Whatever
else Ian may have done, I suggest that there's more than enough
blame to go around here.

I think Martin may have caught the diplomacy bug from Dan Pop. He
did not catch the associated accuracy bug, which is much less apt
to spread in humans.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
 
I

Ian Collins

Keith said:
Martin, you accused Ian Collins of offering bogus advice. In fact, he
*corrected* the bogus advice that someone else had offered, and you
have not acknowledged your own error. Whatever else Ian may have
done, I suggest that there's more than enough blame to go around here.
Thank you Keith.

I probably shouldn't have started this in the first place, I'd just read
an unnecessarily rude response form Martin to another response of mine
on another thread and couldn't resist the obvious error.

I also strongly object to people on Usenet using nouns like 'idiot' for
people they don't know.
 
M

Martin Ambuhl

Keith said:
In a post that was a direct followup to a post by Ian Collins, you wrote:

| It is not superfluous for me to note that your 'advice' was not only
| off-topic but *wrong*. For God's sake, if you want to post
| off-topic answers, at least be close to being right.

This is in response to his sticking in a completely unwarranted
statement that my post was "superfluous." Nowhere in the thread leading
to it did Ian ever appear, nor did Ian ever indicate why my post was
"superflyous." There was no reason that someone who posted a parallel
response would be rudely intruding. He didn't even have the decency to
tell me that the reason that my post was "superfluous" was that he had
preempted the field in a parallel post, and he now owned the newsgroup.
It's reasonable to assume that you were addressing Ian directly,

Of course I addressed Ian directly. That I mistook him for someone who
would not claim that a parallel, unreferenced message by him made all
other responses "superfluous" was my error. He obviously is very rude
and he obviously has no clue how newsgroups work. Why the hell are you
in this at all?
 
M

Mark McIntyre

I probably shouldn't have started this in the first place, I'd just read
an unnecessarily rude response form Martin to another response of mine
on another thread and couldn't resist the obvious error.

In point of fact, looking at the threading history on google, Martin
wasn't replying to you at all. You and Keith need to get better
newsreaders, and /or not jump too fast. :)


[FYI here's the sequence with spaces to represent the reply levels]
1 Prasad
2 Neroku posting wrong advice
3 Collins correcting Neroku
3 Ambuhl correcting Neroku
4 Collins flaming Ambuhl by mistake
5 Ambuhl flaming collins in indignation
etc etc etc
I also strongly object to people on Usenet using nouns like 'idiot' for
people they don't know.

Sometimes, you don't need to know someone to detect that they're an
idiot.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
K

Keith Thompson

Mark McIntyre said:
In point of fact, looking at the threading history on google, Martin
wasn't replying to you at all. You and Keith need to get better
newsreaders, and /or not jump too fast. :)

Martin did reply directly to Ian, and incorrectly accused him of
posting bogus information. See
<http://groups.google.com/group/comp.lang.c/msg/9efd288957a0055f>.
Possibly he did not intend the word "you" to refer to the poster of
the article to which he was directly replying.
 
M

Mark McIntyre

Martin did reply directly to Ian, and incorrectly accused him of
posting bogus information. See
<http://groups.google.com/group/comp.lang.c/msg/9efd288957a0055f>.
Possibly he did not intend the word "you" to refer to the poster of
the article to which he was directly replying.

Keith, go back and read the google threading again. You've started too
far down the thread. .

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top