1

I have a simple C API (N simple functions). I want to wrap it into C#, Java and Python at the same time. How to call SWIG to create wrapper for multiple languages at the same time?

Something like this

swig.exe -c++ -csharp -java -namespace Bla outdir ./ -o ./BlaAPIWrapper.cxx BlaAPI.i

results in swig application crush

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.

Works fine for each language sepratly.

DuckQueen
  • 772
  • 10
  • 62
  • 134

1 Answers1

3

Just call it multiple times with different parameters, one for Java, one for C# etc..

You probably need some shell script to automate that, but once you create the script that generates the wrapper just call the script.

That's probably the easiest solution if swig don't allow multiple languages at one go, or if that feature is present but bugged (or if it is present but undocumented and you were not able to use it because missing important information).

CoffeDeveloper
  • 7,961
  • 3
  • 35
  • 69