[rhn-users] g++

Craig M. Jameson cjarith at comcast.net
Mon Sep 26 14:35:31 UTC 2005


Sure enough. Thanks a bunch.

Craig.


On Mon, 2005-09-26 at 13:34 +0900, Naoki wrote:
> Yeah, that one bit me for a while as well.  You need to add to the first
> one : "using namespace std;" and then it'll know.
> 
> 
> 
> On Sun, 2005-09-25 at 22:23 -0600, Craig M. Jameson wrote:
> > I am befuddled. I am an amateur administrator trying to compile my first
> > C++ program. (Actually, the compile succeeded.) I tried to compile the
> > following two programs:
> > 
> > #include <iostream>
> > #include <stdlib.h>
> > int main(int argc, char *argv[]) {     cout << "hey"; return 0; }
> > 
> > and
> > 
> > #include <iostream>
> > #include <stdlib.h>
> > int main(int argc, char *argv[]) {std::cout << "hey"; return 0; }
> > 
> > The second compiles. The first does not. (Every presumably reliable
> > source I have seen says to write this as in the first case.) Can I rule
> > out a problem with my installation? (i.e. is this a problem with my
> > understanding of linux or C++?)
> > 
> > I compile using the command
> >    g++ -v filename.C
> > 
> > The output for the first case contains
> > 
> >    #include <...> search starts here:
> >     /usr/lib/gcc/i386-redhat-linux/3.4.3/../../../../include/c++/3.4.3
> > 
> > where iostream is located, and
> > 
> >    error: `cout' undeclared (first use this function)
> > 
> > (When I compile the second case, in runs fine.)
> > 
> > 
> > Craig.
> > 
> > 
> > _______________________________________________
> > rhn-users mailing list
> > rhn-users at redhat.com
> > https://www.redhat.com/mailman/listinfo/rhn-users
> 
> 
> _______________________________________________
> rhn-users mailing list
> rhn-users at redhat.com
> https://www.redhat.com/mailman/listinfo/rhn-users




More information about the rhn-users mailing list