From: "Paul Cechner" Newsgroups: comp.os.msdos.djgpp References: <8tndkb$pu7$1 AT slb1 DOT atl DOT mindspring DOT net> <39ff50ed DOT 52358905 AT news DOT freeserve DOT net> <8tnnpk$61u$1 AT slb1 DOT atl DOT mindspring DOT net> Subject: Re: Need help - String Class (compiling/linking) Lines: 73 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Wed, 1 Nov 2000 09:35:01 +0800 NNTP-Posting-Host: 203.24.93.65 X-Complaints-To: abuse AT telstra DOT net X-Trace: nsw.nnrp.telstra.net 973042394 203.24.93.65 (Wed, 01 Nov 2000 12:33:14 EST) NNTP-Posting-Date: Wed, 01 Nov 2000 12:33:14 EST Organization: Customer of Telstra Big Pond Direct To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com the class name is actually 'string' (note the lowercase 's'), not 'String' -- note: spam resistant email ---------------------- Paul Cechner Charlie Hall wrote in message news:8tnnpk$61u$1 AT slb1 DOT atl DOT mindspring DOT net... > I tried what you suggested, and now I get the following error messages: > > In function 'int main()': > 'String' undeclared (first use this function) > parse error before '(' > > By the way, I get the same errors when I run it directly from RHIDE. > > You mentioned that _String.h is just a DJGPP thing. What is ? Is > it the "standard C++" string class header? > > Any thoughts? > > Thanks, > Charlie > > > Steamer wrote in message > news:39ff50ed DOT 52358905 AT news DOT freeserve DOT net... > > Charlie Hall wrote: > > > > >I've successfully written and run programs that use , > > > > is non-standard, so it's better to use . > > (Remember, however, that this puts everything in namespace std.) > > > > >and I've just attempted to use the String class, > > >which I assume is in <_String.h>. > > > > <_String.h> is just a DJGPP thing - what you want is . > > > > > Here's my code: > > > > > > // Program: list.cpp > > > #include <_String.h> > > > > > > int main() > > > { > > > String s1('a'); > > > return 0; > > > } > > > > Try this: > > > > > > #include > > using std::string; > > > > int main() > > { > > string s1("a"); > > return 0; > > } > > > > > > Compile like this: > > > > gpp -Wall -O2 list.cpp -o list.exe > >