This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: NEWBIE: cout<< problem
- From: Muthukumar Ratty <muthu at iqmail dot net>
- To: Arash Bijanzadeh <a dot bijanzadeh at linuxiran dot org>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Mon, 5 May 2003 00:00:33 -0700 (PDT)
- Subject: Re: NEWBIE: cout<< problem
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?
>