From: Jason Green Newsgroups: comp.os.msdos.djgpp Subject: Re: gpp can't find headers Date: Sun, 09 Apr 2000 09:44:01 +0100 Organization: Customer of Planet Online Lines: 46 Message-ID: References: <8codd9$equ$1 AT slb6 DOT atl DOT mindspring DOT net> NNTP-Posting-Host: modem-177.vanadium.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news8.svr.pol.co.uk 955270559 22994 62.136.22.177 (9 Apr 2000 08:55:59 GMT) NNTP-Posting-Date: 9 Apr 2000 08:55:59 GMT X-Complaints-To: abuse AT theplanet DOT net X-Newsreader: Forte Agent 1.7/32.534 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Matt Dooner" wrote: > I've followed the instructions in the FAQ, but gpp still can't find my > included headers in c++ programs. Here is the error message from a basic > program that uses a string and vector. Below it is the code of the > program; > #include > #include > #include These are old style headers. You need to use the new style if you want to use the string class: #include #include #include using namespace std; > > int main() > { > vector test; vector test; > test.resize(1); > string test = "test"; test is already defined as type vector so you can not define another variable of type string with the same name. It is not clear what you want to do here, if you wanted a vector of strings then test should have been defined as type vector. If you want a second variable of type string then it must have a unique name: string str = "test"; > cout << test << endl; You can not just output a vector to cout. You must iterate through each value contained in the vector and output them individually. You can still output the string though: cout << str << endl; > }