public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: aka007@mail.com
To: help-gcc@gnu.org
Subject: Re: help, gcc, ?cout error?
Date: Fri, 31 Dec 1999 22:24:00 -0000	[thread overview]
Message-ID: <3853e4af.91799515@usenet.nau.edu> (raw)
Message-ID: <19991231222400.3qJKP3eu_P3OKJmV_0Fjga10bVM_RxPzAtbEeHi03bM@z> (raw)
In-Reply-To: <3853CDE3.331411D4@mindspring.com>

thanks for letting me know what the diff was with gcc vs g++...

hope this is still valid here?  anyhow, here is current version of my
"hello" program:

UW PICO(tm) 2.9                  File: a.cpp

#include <iostream>
using namespace std;

int main() {
  cout << "hello";
  return 0;
}

using command g++ -o a a.cpp , then it "thinks" for a moment, but
creates no output on the telnet session screen.  pico a.out reveals an
empty file, no "hello" in there at all...    at least no error
messages.

so, i'm not even really positive my school has g++, but it doesn't
create an error when i try it using g++, so i figure it is on the
system?  how can i know for sure?  i thought a simple "hello" program,
to confirm i'll be able to do some programming, but maybe not.

any thoughts?

Jesse
aka007@mail.com


On Sun, 12 Dec 1999 10:31:31 -0600, Tom Barron
<tbarron@mindspring.com> wrote:

>Hi, Jesse.  I pasted your code into a file called jesse.cpp on my
>system.  Watch this:
>
>$ gcc jesse.cpp
>/tmp/ccyMXXQa.o: In function `main':
>/tmp/ccyMXXQa.o(.text+0x25): undefined reference to `cout'
>/tmp/ccyMXXQa.o(.text+0x2a): undefined reference to
>`ostream::operator<<(int)'
>collect2: ld returned 1 exit status
>$ g++ jesse.cpp
>$ a.out
>5$ 
>
>The problem is that cout and iostream.h are part of C++, but gcc only
>handles C.  To compile C++ code, you need to invoke the compiler as g++.
>
>To get a newline on the end of your output, you might want to do
>
>     cout << a << endl;
>
>hth...
>Tom
>
>aka007@mail.com wrote:
>> 
>> i modified it a bit, here is the current version:
>> 
>>    UW PICO(tm) 2.9                  File: a.cpp
>> ...

  reply	other threads:[~1999-12-31 22:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-11 17:34 aka007
1999-12-11 17:49 ` Dave Topham
1999-12-31 22:24   ` Dave Topham
1999-12-11 17:49 ` Dave Topham
1999-12-11 20:34   ` aka007
1999-12-12  9:09     ` Tom Barron
1999-12-12 12:35       ` aka007 [this message]
1999-12-12 15:35         ` Rick Dearman
1999-12-31 22:24           ` Rick Dearman
1999-12-12 19:56         ` Arthur Gold
1999-12-31 22:24           ` Arthur Gold
1999-12-13 10:01         ` Greg Wimpey
1999-12-31 22:24           ` Greg Wimpey
1999-12-31 22:24         ` aka007
1999-12-31 22:24       ` Tom Barron
1999-12-31 22:24     ` aka007
1999-12-31 22:24   ` Dave Topham
1999-12-12 21:35 ` aka007
1999-12-31 22:24   ` aka007
1999-12-31 22:24 ` aka007

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=3853e4af.91799515@usenet.nau.edu \
    --to=aka007@mail.com \
    --cc=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).