How to use dlopen on OS X?

I’m working on making a set of native libraries for various platforms (OS X, Windows, iOS, and Android). On OS X, I have a bundle. For Windows, I opened the native dll with the following code:

        internal static void LoadNativeDll(string FileName)
        { 
            if (lib != IntPtr.Zero)
            {
                return;
            }
	        lib = LoadLibrary(FileName);
            if (lib == IntPtr.Zero)
            {
                Debug.LogError("Failed to load native library! ");
            }
        }

        [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)]
        internal static extern IntPtr LoadLibrary(
    		string lpFileName
    		);

I am trying the following for OS X:

	 	public static IntPtr LoadLibrary(string fileName) {
			return dlopen(fileName, RTLD_NOW);
		}
			
		public static void FreeLibrary(IntPtr handle) {
			dlclose(handle);
		}
			
		public IntPtr GetProcAddress(IntPtr dllHandle, string name) {
			// clear previous errors if any
			dlerror();
			var res = dlsym(dllHandle, name);
			var errPtr = dlerror();
			if (errPtr != IntPtr.Zero) {
				throw new Exception("dlsym: " + Marshal.PtrToStringAnsi(errPtr));
			}
			return res;
		}
			
		const int RTLD_NOW = 2;
			
		[DllImport("libdl.so")]
		private static extern IntPtr dlopen(String fileName, int flags);
			
		[DllImport("libdl.so")]
		private static extern IntPtr dlsym(IntPtr handle, String symbol);
			
		[DllImport("libdl.so")]
		private static extern int dlclose(IntPtr handle);
			
		[DllImport("libdl.so")]
		private static extern IntPtr dlerror();

This is based on a blog I found. OS X is UNIX based, but there does not appear to be a version of libdl.so compiled for OS X and thus get the error:

DllNotFoundException: libdl.so

Even if one did exist, would it need to be packaged within the asset folder? MacMono seems to be an option that used to exist. Help, how do people load libraries in OS X?

I fixed this by using libdl.dylib instead of libdl.so . I got this idea from a Wikipedia article. I also wrote a blog with more details.