質問

I execute dlopen method in a Monomac application:

MonoMac.ObjCRuntime.Dlfcn.dlopen("/.../SomeFramework.framework/SomeFramework", 0);

The first parameter is an absolute path to some external framework. This method always returns null pointer. How to use absolute paths to load dynamic libraries in a Monomac app?

If I add LSEnvironment key to Info.plist with the path containing the framework folder dlopen with the first parameter equal to "SomeFramework.framework/SomeFramework" works.

But my application is a general C# console application and it doesn't contain Info.plist, so I can't add the setting there.

役に立ちましたか?

解決

The framework was dependent on another framework that was not present in path.

The problem was fixed by adding DYLD_FRAMEWORK_PATH environment variable with paths to folders containing these frameworks (see details in dlopen reference for more details).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top