From: Pieter Thysebaert <pieter.thysebaert@intec.rug.ac.be>
To: Arash Bijanzadeh <a.bijanzadeh@linuxiran.org>, gcc-help@gcc.gnu.org
Subject: Re: NEWBIE: cout<< problem
Date: Mon, 05 May 2003 07:22:00 -0000 [thread overview]
Message-ID: <200305051016.10249.pieter.thysebaert@intec.rug.ac.be> (raw)
In-Reply-To: <200305051129.45487.a.bijanzadeh@linuxiran.org>
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
prev parent reply other threads:[~2003-05-05 7:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-05 6:38 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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200305051016.10249.pieter.thysebaert@intec.rug.ac.be \
--to=pieter.thysebaert@intec.rug.ac.be \
--cc=a.bijanzadeh@linuxiran.org \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).