From: Radical DOT NetSurfer AT delorie DOT com Newsgroups: comp.os.msdos.djgpp Subject: Re: wont compile in DJGPP Date: Mon, 17 Sep 2001 06:41:43 -0400 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <9o2ij8$ak3ka$1 AT ID-72226 DOT news DOT dfncis DOT de> X-Newsreader: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: newsabuse AT supernews DOT com Lines: 71 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Just as an experiment to see what my installation of DJGPP 2.03 (GCC 2.95.3) would do, I tried, and got this output: x.cpp: In function `int main(int, char **)': x.cpp:11: `::numeric_limits' undeclared (first use here) x.cpp:11: parse error before `char' x.cpp:12: `::istreambuf_iterator' undeclared (first use here) x.cpp:12: parse error before `>' x.cpp:13: parse error before `>' x.cpp:14: `it' undeclared (first use this function) x.cpp:14: (Each undeclared identifier is reported only once x.cpp:14: for each function it appears in.) x.cpp:14: `end' undeclared (first use this function) x.cpp:17: ANSI C++ forbids using pointer to a function in arithmetic x.cpp:17: ANSI C++ forbids incrementing a pointer of type `vector > (*)(...)' x.cpp:17: non-lvalue in increment x.cpp:22: request for member `size' in `cs', which is of non-aggregate type `vector > ()(...)' x.cpp:24: ANSI C++ forbids using pointer to a function in arithmetic x.cpp:26: ANSI C++ forbids using pointer to a function in arithmetic Is this what you are getting ? more or less errors then above here? Unfortunately, I am not familiar with 'std' stuff. I only compiled this out of curiousity, like I said. Maybe we'll both learn something new. On Sun, 16 Sep 2001 12:05:18 -0400, "Chris" wrote: > >can i have some help i cant seem to get this to compile in >DJGPP > >#include >#include >#include >#include >#include >#include > >int main() > { > std::ifstream in("dic.txt"); > std::vector cs(std::numeric_limits::max()); > std::istreambuf_iterator it(in); > std::istreambuf_iterator end; > while(it != end) > { > unsigned char ch=(unsigned char)*it++; > ++cs[ch]; > } > in.close(); > unsigned char pos='\0'; > std::size_t icount = 0; > while(pos != cs.size()) > { > if (cs[pos] > 0) > { > std::cout<<(char)pos<<": "< if(++icount%5==0) > std::cout<<'\n'; > } > ++pos; > } > std::cout<<"Goodbye"< }