From: SourceForge.net <no...@so...> - 2012-03-23 23:30:46
|
Bugs item #3497393, was opened at 2012-03-06 00:21 Message generated for change (Comment added) made by dfroger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3497393&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: python Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: namespace/using breaks shared_ptr typemap Initial Comment: if the 'using std::tr1::shared_ptr;' statement is itself nested in a local namespace, then the shared_ptr typemap breaks down. A small isolated version of the problem has been included in a tarball. Please see the code there for more details. This appears to be a rather odd corner case. However, I managed to spend days confounded by it none the less. I didn't find a solution for my project until after reading the boost_shared_ptr.i file. The offending output when g++ is run on the generated wrapper code is as follows: example_wrap.cxx: In function ‘PyObject* _wrap_MyObject_create(PyObject*, PyObject*)’: example_wrap.cxx:3061: error: ‘shared_ptr’ was not declared in this scope example_wrap.cxx:3061: error: template argument 1 is invalid example_wrap.cxx:3061: error: expected unqualified-id before ‘>’ token example_wrap.cxx:3064: error: ‘result’ was not declared in this scope example_wrap.cxx:3065: error: expected type-specifier before ‘shared_ptr’ example_wrap.cxx:3065: error: expected `)' before ‘shared_ptr’ example_wrap.cxx:3065: error: expected `)' before ‘;’ token ---------------------------------------------------------------------- Comment By: David Froger (dfroger) Date: 2012-03-23 16:30 Message: Hi, Adding "using namespace myName;" beetween %{ %} make the example in tarball works, that is: %{ #include "example.h" using namespace myName; %} Best, David ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3497393&group_id=1645 |