Open valkyrienyanko opened 2 years ago
Nvm closing as this is not a enet related error
Well actually maybe it is, I don't know. When ENet.Library.Initialize()
is executed a DllNotFoundException
is thrown for them. They say they tried putting enet files in every folder of the project.
Weird. The DLL is compiled for recent targets and I haven't had any other bug reports that say it's throwing a exception. The only thing I can think of is some security software or maybe Windows is being a pain in the bum and you need to right click the enet DLL, go to properties, then "Unblock". It's something stupid to do with SmartScreen if I remember correctly.
Just to rule out something silly, this is a 64Bit version of Windows that they're running it on? 64Bit as in x86_64, not 32Bit x86 or ARM64 (AArch64). The latter two options will fail due to incompatible architecture.
Failing this, can you test to see if the problem persists inside a Windows 10/11 virtual machine? It's been a while since I last used ENet-CSharp but I'm pretty sure that the compiled binary isn't at fault since I have other developers using it in production without issues.
Hold up. I mis-read.
You're trying to get this running on a Mac?
Is this Mac running on the Apple Silicon (ARM64/AArch64) platform or is it using the Intel-based x86_64 platform?
Yes their running this on a Mac
They are on the Apple silicon platform
Well that won't work, the bundle file itself for MacOS doesn't include a ARM64/AArch64/Apple Silicon library. You'll either have to compile it yourself or wait until I have a bit of spare time to see if I can do a cross-compile for a Apple Silicon ENet library.
Alright, give this a shot. As stated earlier, I do not own a Apple M1 mac but I just spent an hour or so absorbing knowledge from the Clang compiler manual, Apple Developer knowledge base and Google in the hopes of finding a cross-compiling solution.
I'm sure your friend can move and rename the appropriate files. This may trigger GateKeeper/FileGuard/whatever the name of that mechanism in MacOS is called as it's unsigned, but give it a go.
Keep in mind, your warranty is now void and this is completely unsupported. It may not even work. Use only as directed. I am not responsible if the Mac turns on you and makes your non-apple devices explode in jealousy or crashes randomly during usage.
If your friend has issues using these compiled blobs, may be wise to get them to install Xcode (it's free after all) and compile it using the instructions in the first post.
I had the same issue on the same project (linked here from their discord) and was able to resolve it by adding enet in Nuget instead of a raw dll import.
I'm surprised that the Nuget package of the upstream repo works. I don't believe that's a native blob for the Apple M1 CPU though?
I am on linux, sorry that should have been in my comment. Seems it won't work for macOS then, pity.
@SoftwareGuy I was doing some digging around on this as I'm also in need of Mac and hopefully soon PlayStation, XBox, and Switch support. I found this:
https://docs.unity3d.com/Manual/PluginInspector.html
And this:
Reading through it, it sounds like Unity supports including native C code in your project and it will compile it in the il2cpp build process. It won't work in mono builds or Editor (because of mono).
I'll try it out with enet and if it works, it should make it so enet supports all platforms unity compiles il2cpp with (which I think is all of them).
Managed to get linking to work by simply building from upstream using CMake and swapping out the dylib. Placing this file in place of the libenet.dylib
provided in releases (or enet.dll
as in the original screenshot). I'm not sure if it's possible to patch the dynamic library when using the NuGet package from upstream just by modifying MSBuild configuration.
I have someone who is trying to contribute to my project but their running a Mac and they can't seem to get enet working. They say they have an error / the game simply won't build.
The project has these 2 enet files. They work for me on Windows 10.
I told them to try and put the
enet.bundle
file found from the releases in this repo next to the project files but they got the same error.I also told them to try putting the files found from the releases in https://github.com/nxrighthere/ENet-CSharp/releases but that did not work either and they still get same error on startup.
I will update this issue once they tell me what the actual error message is that they get.