X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: djgpp and string? Date: 14 Feb 2002 11:30:45 GMT Organization: Aachen University of Technology (RWTH) Lines: 26 Message-ID: References: NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 1013686245 18173 137.226.32.75 (14 Feb 2002 11:30:45 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 14 Feb 2002 11:30:45 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Brent Ritchie wrote: > I'm trying to compile the following code, but djgpp won't let me > use strings? why? Because your code is buggy. And the error messages tell you exactly what's wrong. > classa.h:6: 'string' is used as a type, but is not defined as a type. > classa.h:7: 'string' is used as a type, but is not defined as a type. Right, it isn't. The problem is that you don't have "using namespace std;" early enough in your fully preprocessed source for it to affect "classa.h", too. Proper header file design would have you add these lines #include using namespace std; to the start of any header file that uses the 'string' type in any way. Classa.h is such a header that needs those lines. Or you could let the header use std::string so you can get rid of the "using" statement. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.