cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/14/23:57:17

Newsgroups: comp.os.msdos.djgpp
Subject: Re: Need Help Getting Started with STL
From: saint AT phoenix DOT net (Randy Saint)
X-Newsreader: WinVN 0.99.9 (Released Version) (x86 32bit)
References: <uyLx2.7846$lx DOT 3834 AT news2 DOT giganews DOT com>
MIME-Version: 1.0
Lines: 65
Message-ID: <yJNx2.8179$lx.4183@news2.giganews.com>
NNTP-Posting-Date: Sun, 14 Feb 1999 22:51:42 CDT
X-Trace: sv1-R7XnZOM+SyvpqZ87co0LL0CcOnFBP+sx0YwqsOWPiArVutcTcLr8HGclJou5VP4QwF18iG15TT4R0wA!ihJ+TZp5Pgs=
X-Complaints-To: abuse AT GigaNews DOT Com
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
Date: Mon, 15 Feb 1999 04:51:42 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Well, I've fixed my problem.
I removed all the old DJGPP 2.7.x files & directories and reinstalled 2.8.1.
Then I guessed, and added -lstdcxx on the end of the command line.
Now the test program compiles and runs.

I wish I could have seen that command line addition in some documentation 
somewhere.

Thanks,
Randy

In article <uyLx2.7846$lx DOT 3834 AT news2 DOT giganews DOT com>, saint AT phoenix DOT net says...
>
>I'm having some difficulty getting started with the STL that comes with 
DJGPP.
>It sure would help to have some examples, ones that demonstrated the entire 
>file to show what files are included, etc.
>
>Just for starters, I tried this example from ObjectSpace example set.  I 
>figure that the syntax of the STLs may differ, but I get a bunch of compile 
>errors in header files.  I don't know where to start looking.
>Here is the code:
>
>#include <stl.h>
>#include <iostream.h>
>
>int main ()
>{
>  vector <int> v (5);
>  for (int i = 0; i < v.size (); i++)
>    v[i] = i + 1;
>  int sum = accumulate (v.begin (), v.end (), 0);
>  cout << "sum = " << sum << endl;
>  return 0;
>}
>
>That's it.  And the compile command line is:
>gcc -Wall -g -o accum1.exe accum1.cpp
>And the error messages generated are:
>
>In file included from c:/djgpp/lang/cxx/stl_config.h:106,
>                 from c:/djgpp/lang/cxx/stlalgobase.h:36,
>                 from c:/djgpp/lang/cxx/algorithm:30,
>                 from c:/djgpp/lang/cxx/stl.h:4,
>                 from accum1.cpp:1:
>c:/djgpp/lang/cxx/_G_config.h:20: parse error before `__extension__'
>In file included from c:/djgpp/lang/cxx/stlalgobase.h:45,
>                 from c:/djgpp/lang/cxx/algorithm:30,
>                 from c:/djgpp/lang/cxx/stl.h:4,
>                 from accum1.cpp:1:
>c:/djgpp/lang/cxx/type_traits.h:93: parse error before `>'
>c:/djgpp/lang/cxx/type_traits.h:99: parse error before `}'
>...
>
>'til the compiler quits.
>
>I recently upgraded to version 2.8.1.  
>Am I including the wrong files, using improper syntax for the vector class, 
>leaving something out of the compile statement, or what?
>
>Thanks, in advance,
>Randy
>
>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019