Subject: [mingw32] Help with STL
From: [email-masked] (Bradley Venner)

6 Mar 1998 02:38:21 -0800
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
To: [email-masked]

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,
                 from stl_example.cc:3:
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 `&'
F:\\egcs\\include\\g++/stl_vect
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 
appreciated.

-----------------------------------
#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"));
  //print
}

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