3

I am using swig to generate a C# wrapper to my code. But then I also need to link the dynamic library, which is a Linux .so file. Is it possible to do this from C#?

Thanks

Edit: using a .so file on Windows.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
KaiserJohaan
  • 9,028
  • 20
  • 112
  • 199

3 Answers3

1

There is no direct way to do this. You need to create a native Windows version of all your native code (the so itself, plus all dependencies).

Other options include writing all your code on Linux, if possible, including the C# portion (using Mono). Or creating some sort of client/server setup, where your native code remains on Linux (as a server application) and your C# code goes on the Windows-client. If that is a viable solution for you is hard to tell without further details.

Christian.K
  • 47,778
  • 10
  • 99
  • 143
0

This Post seems to have some answers for Linux, are you trying to do this in Windows?

Community
  • 1
  • 1
Carl Winder
  • 938
  • 8
  • 18
0

It's more than likely that your shared library will have been compiled to use linux command calls.

The only possible way to use linux .so files in a "windows" app would be to compile it (your app) using cygwin, but that way would make your windows app a posix app which means it would have to fire cygwin up everytime it runs.

Joseph Le Brech
  • 6,541
  • 11
  • 49
  • 84