我的应用程序使用SWIG在Windows上的c ++和python之间进行通信。
假设我的界面是“example.h”
swig正在生成example.py,example_wrap.cxx
/* File : example.i */
%module example
%{
#include "example.h"
%}
%include "std_string.i"
%include "std_wstring.i"
%include "example.h"
我将我的应用程序移植到MAC。我需要在mac上生成example.py,example_wrap.cxx吗?或者我可以使用已生成的文件吗?
答案 0 :(得分:1)
无论在何处执行平台,SWIG都会生成相同的代码。
如果该代码的任何部分是特定于OS /编译器/等的(例如,在Windows上为C#调用约定),则由C ++ resp的条件编译处理。目标语言中的类似技术。