gcc323 and gcc332 101
Xiong,Ming
ming.xiong@isis.vanderbilt.edu
Thu Jan 29 17:31:00 GMT 2004
It has nothing to do with difference between "" and <>
Simply predeclare "using namespace std;" when you use #include
<iostream>
-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Crescioli, Phil
Sent: Thursday, January 29, 2004 11:22 AM
To: gcc-help@gcc.gnu.org
Subject: gcc323 and gcc332 101
Hello,
I've created a very basic test routine to start my own
unique testing of a gcc323 and gcc332 install using c++
that I have recently placed in separate dirs in my NFS
mounted home account on a solaris 8 box. Using c++ I get it
to build and run but am having errors using #include<iostream>.
Any replies are appreciated.
//#include "iostream.h"
//#include <iostream.h>
#include <iostream>
int main(void)
{
cout << "main() reporting that GCC compiled this ok" << endl ;
return (0);
} /* main */
I get it to build using #include <iostream.h> or #include "iostream.h"
but am warned with the following message:
[langley]:/home/philc/GCC/test>g++ -o test2 test2.cpp
In file included from [langley]:/home/philc/GCC/test>g++ -o test2
test2.cpp
In file included from
/home/philc/GCC/gcc323bin/include/c++/3.2.3/backward/iostream.h:31,
from test2.cpp:2:
/home/philc/GCC/gcc323bin/include/c++/3.2.3/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 17.4.1.2 of the C++ standard. Examples include substituting the
<X> header for the <X.h> header for C++ includes, or <sstream> instead
of the deprecated header <strstream.h>. To disable this warning use
-Wno-deprecated.
I cannot get it to build using #include <iostream>. I get the following
compile time error:
[langley]:/home/philc/GCC/test> g++ -o test2 test2.cpp
test2.cpp: In function `int main()':
test2.cpp:6: `cout' undeclared (first use this function)
test2.cpp:6: (Each undeclared identifier is reported only once for each
function it appears in.)
test2.cpp:6: `endl' undeclared (first use this function)
I though I understood the "" and <> meaning until now...
Regards,
Phil
Phil.Crescioli@gd-ais.com
More information about the Gcc-help
mailing list