Swig Argument Error When Using "using Std::vector" In Python
This is very related to this question Regardless of whether or not this is coding practice, I have come across code that looks like this test.hh #include
Solution 1:
To me, this looks like SWIG does not support the using std::vector;
statement correctly. I think it's a SWIG bug. I can think of the following workarounds:
- Add
using namespace std;
to the SWIG interface file (this will only affect the way wrappers are created; theusing
statement will not enter C++ code) - Add
#define vector std::vector
to the SWIG interface file (this will only work ifvector
is never used asstd::vector
) - Copy the declarations from the header file to the SWIG interface file, and change
vector
tostd::vector
. This will cause SWIG to generate correct wrappers, and again will not affect the C++ library code.
Post a Comment for "Swig Argument Error When Using "using Std::vector" In Python"