[Mono-list] Can't get a simple shared object to be used - DllNotFoundException

thomasw234 Thomas.Wormald at sungard.com
Tue Jul 30 16:05:57 UTC 2013


I'm trying to get my head around making use of Linux shared object files. I
have created a basic C-based shared object which prints ("Shared Object
Called") when main() is called. Compiled it in gcc with -fPIC and got
libshared.so as an output.

Go into C#, add [DllImport("libshared.so")] public static extern int main();
Call main(), get a DllNotFoundException. libshared.so is in the same
directory as the c# program.

I thought it might be a platform problem (I'm using 64 bit fedora 18, and 64
bit mono 3.20), but I've tried building the shared object with both -m32 and
-m64 arguments, with no luck.

I can provide code if it helps, but the machine that I'm building is a
corporate machine that isn't allowed on the internet, so I'll have to copy
it out line-by-line.


View this message in context: http://mono.1490590.n4.nabble.com/Can-t-get-a-simple-shared-object-to-be-used-DllNotFoundException-tp4660332.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list