This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[mingw32] Help with STL

I would like to use the Template Numerical Toolkit from NIST as part
of a project.  However, I have had trouble with the STL library with
both the gcc2.8.0 and egcs distributions.  For example, using some
example code from an STL tutorial (below), I get the following errors
using the egcs compiler
In file included from F:\\egcs\\include\\g++/vector.h:32,
F:\\egcs\\include\\g++/stl_vector.h:40: parse error before `>'
F:\\egcs\\include\\g++/stl_vector.h:44: syntax error before `*'
F:\\egcs\\include\\g++/stl_vector.h:45: syntax error before `*'
F:\\egcs\\include\\g++/stl_vector.h:46: syntax error before `*'
F:\\egcs\\include\\g++/stl_vector.h:47: syntax error before `*'
F:\\egcs\\include\\g++/stl_vector.h:48: syntax error before `&'
and then an illegal operation notice from windows. 

The compiler seems to work on non-template code (i.e. egcs compiled
Lapack) and other non-template C++ code (i.e. the FADBAD automatic
differentiation package).  

I would eventually like to link with S-plus or Matlab, for which I
only can afford Windows licences, so I would like to stay in the
Windows environment if possible.  Any help or advice would be 

#include <iostream.h>
#include <stdlib.h>
#include <vector.h>
#include <function.h>
main (int argc, char *argv[])
  int n = atoi (argv[1]); // argument checking removed for clarity
  vector<int> v;
  for (int i = 0; i < n; i++)   // append integers 0 to n-1 to v
    v.push_back (i);
  random_shuffle (v.begin(), v.end());    // shuffle
  copy (v.begin(), v.end(), ostream_iterator<int> (cout, "\n"));

Bradley Venner
Department of Biometry and Epidemiology
Medical University of South Carolina
For help on using this list (especially unsubscribing), send a message to
"" with one line of text: "help".

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]