Closed nesk closed 3 years ago
I think linux version should work.
Because manual loading of libs is only on macos. (see Methods.cs)
I will try to fix that (load without lib
, .dylib
etc like a minigun catching a fly)
Thanks for feedback!
I can try to run some patches if you need help π
I tried variants like UltralightCore.dylib
, libUltralightCore
, UltralightCore
, it didn't work.
I will try other things, now I see where it fails.
Ooooh, it's a simple issue with relative/absolute paths. If I change like that, it works:
#if NET5_0_OR_GREATER
// i don't have iphone/mac, and probably never
// so it will not work for ios, i'm sure 100%%%
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
string[] libs = new[] { "libUltralightCore.dylib", "libWebCore.dylib", "libUltralight.dylib" };
foreach(string lib in libs)
{
- string path = $"runtimes/osx-x64/native/{lib}";
+ string path = $"/Users/johann/dev/UltralightNet/UltralightNet.AppCore.TestApp/bin/Debug/net5.0/runtimes/osx-x64/native/{lib}";
if (File.Exists(path))
{
NativeLibrary.Load(path);
continue;
}
NativeLibrary.Load(lib);
}
}
#endif
I can't work on this right now, but I will create a PR to solve that. π
Ooooh, it's a simple issue with relative/absolute paths. If I change like that, it works:
#if NET5_0_OR_GREATER // i don't have iphone/mac, and probably never // so it will not work for ios, i'm sure 100%%% if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { string[] libs = new[] { "libUltralightCore.dylib", "libWebCore.dylib", "libUltralight.dylib" }; foreach(string lib in libs) { - string path = $"runtimes/osx-x64/native/{lib}"; + string path = $"/Users/johann/dev/UltralightNet/UltralightNet.AppCore.TestApp/bin/Debug/net5.0/runtimes/osx-x64/native/{lib}"; if (File.Exists(path)) { NativeLibrary.Load(path); continue; } NativeLibrary.Load(lib); } } #endif
I can't work on this right now, but I will create a PR to solve that. π
Can you try using Path.Combine(typeof(Methods).Assembly.Location, "runtimes", "osx-x64", "native", lib)
?
If it will work, you can submit a pr then.
When I try to run
UltralightNet.AppCore.TestApp
on macOS, I use the following commands:And I get the following error:
FYI, the same commands work perfectly on Windows, I didn't try on Linux tho but I think it could fail the same (and it will be easier to reproduce if you don't have an Apple device).
Maybe you know what happens here? π