I try the SWIG STL vector example from: http://www.swig.org/Doc1.3/Library.html#Library_nn15
calling swig seems to work for all languages, except for python (the one I want): [EMAIL PROTECTED]:~/ar$ swig -python example.i /usr/share/swig1.3/python/std_common.i:9: Error: Syntax error in input(1). Does anyone know what I can do to make it work? A google search only showed http://blog.isnotworking.com/2006/08/word-of-caution-distutils-swig-stl.html about setting an undocumented swig_opts=['-c++'] option in setup.py, I don't know what setup.py file that is (and strace shows swig doesn't look for setup.py files). Other languages work OK with the same example.[ih] files: [EMAIL PROTECTED]:~/ar$ swig -tcl example.i [EMAIL PROTECTED]:~/ar$ swig -perl5 example.i [EMAIL PROTECTED]:~/ar$ swig -java example.i [EMAIL PROTECTED]:~/ar$ swig -csharp example.i Here are the example.i and example.h files, copied from http://www.swig.org/Doc1.3/Library.html#Library_nn15 [EMAIL PROTECTED]:~/ar$ cat example.i %module example %{ #include "example.h" %} %include "std_vector.i" // Instantiate templates used by example namespace std { %template(IntVector) vector<int>; %template(DoubleVector) vector<double>; } // Include the header file with above prototypes %include "example.h" [EMAIL PROTECTED]:~/ar$ cat example.h /* File : example.h */ #include <vector> #include <algorithm> #include <functional> #include <numeric> double average(std::vector<int> v) { return std::accumulate(v.begin(),v.end(),0.0)/v.size(); } std::vector<double> half(const std::vector<double>& v) { std::vector<double> w(v); for (unsigned int i=0; i<w.size(); i++) w[i] /= 2.0; return w; } void halve_in_place(std::vector<double>& v) { std::transform(v.begin(),v.end(),v.begin(), std::bind2nd(std::divides<double>(),2.0)); } -- Thanks, Joost Witteveen -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]