Newsgroups: comp.os.msdos.djgpp From: manni DOT heumann AT gmx DOT de (Manni Heumann) Subject: Re: stl samples or tutorial References: <005d01bfe74f$4724f420$0307028a AT prmivv03> <002e01bfe7d5$c0c74b80$0307028a AT prmivv03> X-Newsreader: News Xpress 2.01 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Fri, 07 Jul 2000 06:58:56 GMT NNTP-Posting-Host: ppp36-225.hrz.uni-bielefeld.de Message-ID: <39657fb2_1@news.uni-bielefeld.de> X-Trace: 7 Jul 2000 08:58:58 +0200, ppp36-225.hrz.uni-bielefeld.de Lines: 42 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > >Hi everybody, >I am looking for sample code for stl running with djgpp. I am just testing >examples from ObjectSpace, but some of them cannot be compiled (stack1.cpp >for example - see attached file). >Please let me know about some easy collection of examples which might run >with djgpp. > >Thanks, Petr Maxa. >#include >#include > >int main () >{ > stack > s; > s.push (42); > s.push (101); > s.push (69); > while (!s.empty ()) > { > cout << s.top () << endl; > s.pop (); > } > return 0; >} How could this possibly compile? s is a stack of deques, and you are trying to push ints into that. This is positively not a problem with djgpp, but with the code. How old are those samples, anyway? should not be in modern code, use instead. And including will give you HUGE compile times. It's better to include only those headers you really need ( and in your case). -- Manni