【问题标题】:SWIG cross platformSWIG 跨平台
【发布时间】:2010-10-22 14:09:03
【问题描述】:

我的应用程序正在使用 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 吗?或者我可以使用已经生成的文件吗?

【问题讨论】:

    标签: python windows macos swig


    【解决方案1】:

    无论在哪个平台上执行,SWIG 都会生成相同的代码。

    如果该代码的任何部分是特定于操作系统/编译器/等的(例如,在 Windows 上为 C# 调用约定),这将由 C++ 的条件编译处理。目标语言中的类似技术。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-15
      • 1970-01-01
      • 2011-04-14
      • 2019-05-15
      • 2019-12-28
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      相关资源
      最近更新 更多