[英]how to pass unsigned int reference to from python to C++ using swig?
我正在使用swig,它包装了我的C ++函数之一:
get(unsigned int a, unsigned int &b);
但我无法从python调用此函数,我得到的错误是TypeError,应将其取消签名int&
如何从python调用此函数? 我应该在.i文件中添加一些特殊内容吗?
是的,您应该添加类型图。
export.i:
%module my_mod
%include“ typemaps.i”
%apply unsigned int&OUTPUT {unsigned int&}; //您输出的这张地图
%include“ export.h”
出口
无效get(unsigned int a,unsigned int&b);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.