public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* NEWBIE: cout<< problem
@ 2003-05-05  6:38 Arash Bijanzadeh
  2003-05-05  6:40 ` Michal Liptak
  0 siblings, 1 reply; 5+ messages in thread
From: Arash Bijanzadeh @ 2003-05-05  6:38 UTC (permalink / raw)
  To: gcc-help

Hi all,
I wonder why I cann't compile the famous cout <<"Hello, world!"<<endl; with 
gcc? Can anybody describe the situation?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NEWBIE: cout<< problem
  2003-05-05  6:38 NEWBIE: cout<< problem Arash Bijanzadeh
@ 2003-05-05  6:40 ` Michal Liptak
  2003-05-05  7:01   ` Arash Bijanzadeh
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Liptak @ 2003-05-05  6:40 UTC (permalink / raw)
  To: gcc-help

#include <iostream>

using namespace std;
int main(void) {
  cout<<"Hello world"<<endl;
  return 0;
}

On Mon, 5 May 2003 11:07:15 +0430
Arash Bijanzadeh <a.bijanzadeh@linuxiran.org> wrote:

>Hi all,
>I wonder why I cann't compile the famous cout <<"Hello, world!"<<endl; with 
>gcc? Can anybody describe the situation?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NEWBIE: cout<< problem
  2003-05-05  6:40 ` Michal Liptak
@ 2003-05-05  7:01   ` Arash Bijanzadeh
  2003-05-05  7:21     ` Muthukumar Ratty
  2003-05-05  7:22     ` Pieter Thysebaert
  0 siblings, 2 replies; 5+ messages in thread
From: Arash Bijanzadeh @ 2003-05-05  7:01 UTC (permalink / raw)
  To: gcc-help

Still same problem, se below my hello.cpp and the gcc error message:

ab@gorg:~/cpptut$ cat hello.cpp
#include <iostream>

using namespace std;
int main(void) {
          cout<<"Hello world"<<endl;
            return 0;
}
ab@gorg:~/cpptut$ gcc -o hello hello.cpp
/tmp/ccNKWoGc.o: In function `main':
/tmp/ccNKWoGc.o(.text+0xa): undefined reference to `endl(ostream &)'
/tmp/ccNKWoGc.o(.text+0x17): undefined reference to `cout'
/tmp/ccNKWoGc.o(.text+0x1c): undefined reference to `ostream::operator<<(char 
const *)'
/tmp/ccNKWoGc.o(.text+0x27): undefined reference to 
`ostream::operator<<(ostream &(*)(ostream &))'
collect2: ld returned 1 exit status





On Monday 05 May 2003 11:08, Michal Liptak wrote:
> #include <iostream>
>
> using namespace std;
> int main(void) {
>   cout<<"Hello world"<<endl;
>   return 0;
> }
>
> On Mon, 5 May 2003 11:07:15 +0430
>
> Arash Bijanzadeh <a.bijanzadeh@linuxiran.org> wrote:
> >Hi all,
> >I wonder why I cann't compile the famous cout <<"Hello, world!"<<endl;
> > with gcc? Can anybody describe the situation?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NEWBIE: cout<< problem
  2003-05-05  7:01   ` Arash Bijanzadeh
@ 2003-05-05  7:21     ` Muthukumar Ratty
  2003-05-05  7:22     ` Pieter Thysebaert
  1 sibling, 0 replies; 5+ messages in thread
From: Muthukumar Ratty @ 2003-05-05  7:21 UTC (permalink / raw)
  To: Arash Bijanzadeh; +Cc: gcc-help


DISCLAIMER: I am not a C++ guy :)

that said...

try g++ hello.cpp

Muthu

> Still same problem, se below my hello.cpp and the gcc error message:
>
> ab@gorg:~/cpptut$ cat hello.cpp
> #include <iostream>
>
> using namespace std;
> int main(void) {
>           cout<<"Hello world"<<endl;
>             return 0;
> }
> ab@gorg:~/cpptut$ gcc -o hello hello.cpp
> /tmp/ccNKWoGc.o: In function `main':
> /tmp/ccNKWoGc.o(.text+0xa): undefined reference to `endl(ostream &)'
> /tmp/ccNKWoGc.o(.text+0x17): undefined reference to `cout'
> /tmp/ccNKWoGc.o(.text+0x1c): undefined reference to `ostream::operator<<(char
> const *)'
> /tmp/ccNKWoGc.o(.text+0x27): undefined reference to
> `ostream::operator<<(ostream &(*)(ostream &))'
> collect2: ld returned 1 exit status
>
>
>
>
>
> On Monday 05 May 2003 11:08, Michal Liptak wrote:
> > #include <iostream>
> >
> > using namespace std;
> > int main(void) {
> >   cout<<"Hello world"<<endl;
> >   return 0;
> > }
> >
> > On Mon, 5 May 2003 11:07:15 +0430
> >
> > Arash Bijanzadeh <a.bijanzadeh@linuxiran.org> wrote:
> > >Hi all,
> > >I wonder why I cann't compile the famous cout <<"Hello, world!"<<endl;
> > > with gcc? Can anybody describe the situation?
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NEWBIE: cout<< problem
  2003-05-05  7:01   ` Arash Bijanzadeh
  2003-05-05  7:21     ` Muthukumar Ratty
@ 2003-05-05  7:22     ` Pieter Thysebaert
  1 sibling, 0 replies; 5+ messages in thread
From: Pieter Thysebaert @ 2003-05-05  7:22 UTC (permalink / raw)
  To: Arash Bijanzadeh, gcc-help

On Monday 05 May 2003 08:59, Arash Bijanzadeh wrote:
> Still same problem, se below my hello.cpp and the gcc error message:
>
> ab@gorg:~/cpptut$ cat hello.cpp
> #include <iostream>
>
> using namespace std;
> int main(void) {
>           cout<<"Hello world"<<endl;
>             return 0;
> }
> ab@gorg:~/cpptut$ gcc -o hello hello.cpp
> /tmp/ccNKWoGc.o: In function `main':
> /tmp/ccNKWoGc.o(.text+0xa): undefined reference to `endl(ostream &)'
> /tmp/ccNKWoGc.o(.text+0x17): undefined reference to `cout'
> /tmp/ccNKWoGc.o(.text+0x1c): undefined reference to
> `ostream::operator<<(char const *)'
> /tmp/ccNKWoGc.o(.text+0x27): undefined reference to
> `ostream::operator<<(ostream &(*)(ostream &))'
> collect2: ld returned 1 exit status
>

Since it's a C++ program:
try "g++ -o hello hello.cpp" or "gcc -o hello hello.cpp -lstdc++"

Pieter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-05-05  7:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-05  6:38 NEWBIE: cout<< problem Arash Bijanzadeh
2003-05-05  6:40 ` Michal Liptak
2003-05-05  7:01   ` Arash Bijanzadeh
2003-05-05  7:21     ` Muthukumar Ratty
2003-05-05  7:22     ` Pieter Thysebaert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).