Вопрос

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top