From: <and...@hi...> - 2009-10-30 15:50:21
|
Hi William Thank you for your quick reply. Sorry for my mistake in the command line. As you pointed out, the correct command line should be: swig -c++ -python example.i Still, even with that command line I do get the same error. I now stronly suspect that something is wrong with my boost installation. Anyway, I have now found a way around my problem by using %template This works fine and swig rocks again for me. Best regards Andreas ---- William S Fulton <ws...@fu...> schrieb: > 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 |