Hello,
I have a C# class that uses .NET
I want to invoke it's code from Java on Linux.
I have used MONO to create the DLL of this code:
mcs /target:library /out:[login to view URL] -platform:x64 [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL]
I have created a Java class to load this DLL:
class FSBridge {
static {
try {
[login to view URL]("/tmp/[login to view URL]");
} catch (UnsatisfiedLinkError e) {
[login to view URL]("Native code library failed to load.\n" + e);
[login to view URL](1);
}
}
public static void main(String[] args) {
[login to view URL]("Start..");
// TODO add code to invoke C# function 'Filter'
[login to view URL]("End.");
}
}
It compiles OK but when I run it I see this..
user@host>java FSBridge
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /tmp/[login to view URL] which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Native code library failed to load.
[login to view URL]: /tmp/[login to view URL]: /tmp/[login to view URL]: invalid ELF header (Possible cause: endianness mismatch)
When I execute 'execstack' I see this:
execstack: "[login to view URL]" is not an ELF file
What I need you to do:
1. You need to provide the compilation parameters you used to compile the C# (on Linux) and the Java (on Linux) as well.
2. Get this Java code to execute this C# code without error
by providing an example of this Java code invoking the following C# method found inside [login to view URL]:
public static IEnumerable<Entry> Filter(AllFeedCollection unfilteredFeeds, string FilterString)
So I know you are not a bot, please send a message/comment with the word 'understood' so I know you understand what I wrote.
Thank you.
I look forward to working with you.