linux.so.2 with DllImport in Mono?

I need to dynamically load shared objects in Linux (and in the future, OS X, but one thing at a time) and it seems that actually trying to ld-linux.so.2 will always fail with DllNotFoundException. Trying to load it in a C program seems to fail as well (dlopen returns null).

Is there any other way to dynamically link libraries in Mono without DllImport, possibly a workaround?


You're using the wrong 'library'. You should use libdl (which works both on Linux and OSX).

It would be better if you used DllImport, though, together with Reflection.Emit if dynamic support is needed.

链接地址: http://www.djcxy.com/p/44592.html

上一篇: 在WPF中如何更改代码中的DataTemplate的文本块的文本绑定?

下一篇: linux.so.2与单声道的DllImport?