From: <and...@hi...> - 2009-10-29 12:55:38
|
Hi I am trying to wrap shared_ptr code and I have run into some problems. Running the following code through swig gives an exception: %module example %include <boost_shared_ptr.i> SWIG_SHARED_PTR(Foo, Foo) %inline %{ #include <boost/shared_ptr.hpp> using boost::shared_ptr; struct Foo {}; void test1(shared_ptr<Foo> f) {} //void test2(boost::shared_ptr<Foo> f) {} %} My command line looks like: swig -IC:/boost_1_40_0 -python example.i and I am using swigwin-1.3.40 and boost-1.40.0 The exception I get looks like this: $ swig -IC:/boost_1_40_0 -python example.i example.i(5): Error: Syntax error in input(1). Obviously I am doing something wrong but cannot figure out what the problem is. Does anybody have a minimum example that should work? Incidentally, trying the example fro the test suite (li_boost_shared_ptr.i) gives the same exception. Best regards Andreas |
From: William S F. <ws...@fu...> - 2009-10-29 22:18:38
|
and...@hi... wrote: > Hi > > I am trying to wrap shared_ptr code and I have run into some problems. > Running the following code through swig gives an exception: > > %module example > > %include <boost_shared_ptr.i> > SWIG_SHARED_PTR(Foo, Foo) > > %inline %{ > #include <boost/shared_ptr.hpp> > using boost::shared_ptr; > struct Foo {}; > void test1(shared_ptr<Foo> f) {} > //void test2(boost::shared_ptr<Foo> f) {} > %} > > My command line looks like: > swig -IC:/boost_1_40_0 -python example.i Should be: swig -c++ -python example.i > > and I am using swigwin-1.3.40 and boost-1.40.0 > > The exception I get looks like this: > > $ swig -IC:/boost_1_40_0 -python example.i > example.i(5): Error: Syntax error in input(1). > > Obviously I am doing something wrong but cannot figure out what the problem is. Does anybody have a minimum example that should work? Incidentally, trying the example fro the test suite (li_boost_shared_ptr.i) gives the same exception. > I can't replicate that error using swig-1.3.40, try the correct command line options given above. William |