从Mono在freebsd上加载libc.so.7库
我尝试在FreeBSD上从Mono加载本机库 我已经从库从Mono在freebsd上加载libc.so.7库,mono,freebsd,Mono,Freebsd,我尝试在FreeBSD上从Mono加载本机库 我已经从库libc.so导入了方法dlopen。库具有绝对路径/lib/libc.so.7 public static class NativeMethods { [DllImport("libc.so.7", SetLastError = true)] public static extern IntPtr dlopen(string filename, int flags); const int RTLD_NOW = 2; }
libc.so
导入了方法dlopen
。库具有绝对路径/lib/libc.so.7
public static class NativeMethods
{
[DllImport("libc.so.7", SetLastError = true)]
public static extern IntPtr dlopen(string filename, int flags);
const int RTLD_NOW = 2;
}
正在尝试加载库
static void Main()
{
IntPtr ptr = NativeMethods.dlopen("/lib/libc.so.7", NativeMethods.RTLD_NOW);
// here ptr always equals IntPtr.Zero!!!
}
为什么方法dlopen
无法在freebsd上加载标准库?我无法加载standart库,因此无法加载我创建的其他库
以类似的方式,我在ubuntu15上加载库(在ubuntu15上libdl.so
而不是libc.so.7
),我总是成功的
有什么想法吗?可能是单声道的错误