SWIG: difference between %import and %include

梦想与她 提交于 2019-12-04 01:49:48

The way SWIG works is that it assumes that any valid C++ declarations you provide are to be exposed to the target language. Therefore, any C++ code that SWIG is provided will be used to generate an interface.

%import is an inclusion mechanism that prevents the generation of the interface for the code it includes. That's the difference. So the question you ask when including a header is, "Do I want all of the stuff in this header to be exposed to the target language?" If the answer is "no", then you use %import.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!