What are the best practices when using SWIG with C#?

后端 未结 3 908
陌清茗
陌清茗 2020-12-29 05:55

Has anybody out there used the SWIG library with C#? If you have, what pitfalls did you find and what is the best way to use the library? I am thinking about using it as a

3条回答
  •  情话喂你
    2020-12-29 06:17

    I did attempt to use SWIG to wrap a project C++ for using in .NET a few years ago.

    I didn't get very far as it was a massive giant pain to produce the configuration that SWIG required. At the time I just wanted a solution, not to learn another language/api/etc. SWIG may be easier to use these days, I couldn't tell you.

    We ended up using Managed C++ to wrap the C++ project. It worked really well.

    If you're just invoking functions straight out of a dll, I'd suggest not worrying about either of the above, and just using P/Invoke

提交回复
热议问题