[lug] gcc header files

D. Stimits stimits at idcomm.com
Tue Mar 14 21:39:24 MST 2000


John Starkey wrote:
> 
> I finally rec'd this. Dated 36 hours ago. Has USPS taken over the net:}
> 
> > > Anyone know why these won't go thru???
> > >
> > > I'm pulling from stream inputtxt so:
> > >
> > > inputtxt << fixed << showpoint << setprecision(2)
> >
> > Try calling them specifically as members of ostream. Haven't tested
> > it, but this should work:
> > inputtxt << ostream::fixed << ostream::showpoint <<
> > ostream::setprecision(2);
> >
> 
> I just tried this and rec'd
> 
> no match for 'ifstream & << ios::{anonymous enum}'
> no method 'ostream::setprecision'
> 'fixed' undeclared (first use this function)
> 'showpoint' undeclared (first use this function)

I'm thinking I saw someone answer this, by mentioning the include
files are in /usr/include/g++-2/

On my RH6 system, g++ is configured to know to search g++-2 by default
when using g++...yours might not be. If #include <iostream> or
#include <iomanip> fail, maybe #include <g++-2/iostream>, and #include
<g++-2/iomanip>.

I've noticed some of the distributions are set up slightly different
in terms of default c++ search paths and headers. You'll also find the
equivalent .h files in those include directories, maybe using one of
those will work right.

Incidentally, if you have already done something like "using namespace
std" (or if the headers tried to do this for you), then anything
trying to specifically name "std::" will fail, because it will be
looking for "std::std::" then. Check the headers from your iostream
and iomanip (which unfortunately means following the files they also
include) and check for "using namespace..." lines. A while back I know
SuSE and RH differed in this. What will make that particularly bad is
if this "using namespace..." line is done for you, and this works for
the one file, but #including other files later that rely on *not*
having "using namespace..." lines will then be broken.

Sorry if that's a bit of a tongue-twister :P

> 
> I don't know where to go from here. We are just getting into using ::
> although we have been using namespace std;  in all the code so far.
> 
> Thanks,
> 
> John
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug





More information about the LUG mailing list