I have some C# library - for the sake of simplicity say it has such code:
namespace space1
{
public class Class1
{
public static void Method1()
{
Console.WriteLine("method1");
}
public static string Method2(string str1, string str2)
{
return str1 + " " + str2;
}
}
}
And I want to call it from C++ code somehow. I've been looking around and have tried solutions but non of them were applicable for my case for following reasons:
- Use of Windows API - the program will run exclusively on Linux
- Use of Visual Studio libraries - the C++ program is to be compiled using
gcc
org++
- No changes to the C# library can be made
So far I have not find anything that would meet all requirements. Rewriting the library is out of the question (there could be some wrapper library thou). I would also like to avoid having additional program - like C++ code starting a process and feeding arguments via stdin
, pipes or TCP.