如何创建一个同时适用于多种语言的包装器
How to create a wrapper that would work for multiple languages at the same time?
我有一个简单的C API(N
简单函数)。我想同时将它封装到C#、Java和Python中。如何调用SWIG同时为多种语言创建包装器?
像这样的
swig.exe-c++-csharp-java-namespace Bla-outdir./-o/BlaAPIWrapper.cxx BlaAPI.i
导致swig应用程序崩溃
Assertion failed: !this_, file Modules/lang.cxx, line 332
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
适用于每种语言。
只需用不同的参数多次调用它,一次用于Java,一次为C#等。
您可能需要一些shell脚本来实现自动化,但一旦创建了生成包装器的脚本,就只需调用该脚本。
如果swig
不允许同时使用多种语言,或者该功能存在但被窃听(或者它存在但未记录,并且由于缺少重要信息而无法使用),这可能是最简单的解决方案。
相关文章:
- OpenGL - 在 NDC 中计算位置适用于着色器,但不适用于'regular'程序
- 使用模板参数重载C++方法:如何使其适用于模板的子类?
- 如何修复我的最大公约数代码?它适用于除零和零以外的所有数字
- 选择排序C++(已修改)并非适用于所有情况
- 无法让"std::enable_if"适用于无作用域枚举
- 请找出我的代码中的错误,它在提交得到错误答案的同时仍然适用于我的所有测试用例
- 确定夏令时是否适用于特定日期
- 是否有一种 STL 算法可以最后找到,但它也适用于指针?
- QT 样式表主题,适用于使用属性选择器的整个应用程序
- C++带有适用于左值和右值的引用参数的函数
- 代码适用于调试,但不适用于发布
- C++17 和更新的 std::分配器是否适用于动态数量的自定义堆?
- 适用于大型数组的无复制线程安全环形缓冲区
- NRVO 是否也适用于协程?
- 约束包容是否仅适用于概念?
- 程序只适用于包含(无副作用)cout声明
- 适用于频繁更改的大型数据集的最佳数据结构
- 相同的 for 循环适用于其他项目,但不适用于此项目。为什么?
- 适用于交互式移动地图的语言/框架
- 如何创建一个同时适用于多种语言的包装器