[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]

given this program:

#include <iostream.h>

int main() {

  cout << "Hello, World!" << endl;
  return 0;

 g++ hello.cpp -o hello compiles correctly, but gives me the following
warning (which I understand):

In file included from /usr/include/c++/3.3.2/backward/iostream.h:31,
                 from hello.cpp:1:
/usr/include/c++/3.3.2/backward/backward_warning.h:32:2: warning:
#warning This file includes at least one deprecated or antiquated
header. Please consider using one of the 32 headers found in section of the C++ standard...

so, reading the standard, if I change the program to:

#include <iostream>

the compiler gives me this error:
hello.cpp: In function `int main()':
hello.cpp:5: error: `cout' undeclared (first use this function)
hello.cpp:5: error: (Each undeclared identifier is reported only once
for each function it appears in.)
hello.cpp:5: error: `endl' undeclared (first use this function)

I am on Fedora Core 1 and checking the rpm database, all seems to be
installed for C++ console development. Am I missing the standard
libraries?  I can't figure it out. Also, it is doing this on both of the
Fedora machines I have set up.

Thanks for any help you could offer...

Keith Morris <graphicsguy at charter.net>

<li><strong><a name="00241" href="msg00241.html">[ale] basic gcc compiler issues...</a></strong>
<ul><li><em>From:</em> stephen at phynp6.phy-astr.gsu.edu (Stephen Leonard)</li></ul></li>
<li><strong><a name="00242" href="msg00242.html">[ale] basic gcc compiler issues...</a></strong>
<ul><li><em>From:</em> dmcnash at charter.net (Doug McNash)</li></ul></li>
<li>Prev by Date:
<strong><a href="msg00234.html">[ale] Alabama LUG Fest</a></strong>
<li>Next by Date:
<strong><a href="msg00236.html">[ale] Today's ALE Central meeting</a></strong>
<li>Previous by thread:
<strong><a href="msg00239.html">[ale] ping...</a></strong>
<li>Next by thread:
<strong><a href="msg00241.html">[ale] basic gcc compiler issues...</a></strong>
<li><a href="maillist.html#00235"><strong>Date</strong></a></li>
<li><a href="threads.html#00235"><strong>Thread</strong></a></li>