SoftwareGuy / Ignorance

Ignorance utilizes the power of ENet to provide a reliable UDP networking transport for Mirror Networking.
Other
248 stars 31 forks source link

Dll not found exception #3

Closed dengbohan closed 5 years ago

dengbohan commented 5 years ago

I copy the build to an other PC and report this "DLL not found exception : enet"

SoftwareGuy commented 5 years ago

Can you please tell me the following:

I will be able to troubleshoot your issue further upon getting that information.

dengbohan commented 5 years ago

Can you please tell me the following:

  • What version of Unity you're using? (ie. 2017.4, 2018.2, etc)
  • What platform you built for? (Windows, Linux, Mac, etc)

I will be able to troubleshoot your issue further upon getting that information.

I use 2018.2.18f1,build on windows and tested both mono and il2cpp. The original PC I work on is WIn10 1809 with ryzen 2700x. The test PC is a laptop runs win10 1803 with core 4700MQ. On the orignial pc ,everything goes right. I've checked the resource monitor on test PC and found that the "enet.dll" was just not loaded.

SoftwareGuy commented 5 years ago

Thanks for the extra info. That is helpful.

I'm thinking that it might be related to how I custom built the Windows ENET library, or it could just be that Unity is not copying something to the correct directory on build.

In your game/app build folder, where you have the EXE and data folder, do you have a folder under that data folder called "Plugins"? If so, is there any "enet.dll" file in there?

Just to confirm, you are running a 64Bit Windows installation?

dengbohan commented 5 years ago

Thanks for replying so soon. The plugin folder do exist and the enet.dll is right there too. I use 64bit windows on both two PCs.

SoftwareGuy commented 5 years ago

Are you building a 64bit (x86_64) player, or are you building a 32bit (x86) player?

The ENET dependency is only supported on 64Bit build targets on Windows, Mac and Linux. Check Unity's build target (the architecture option) in the build window. It should be set to x86_64.

Failing that, there should be a Windows directory inside a folder called "Failsafe.zip". If you copy that file and overwrite the enet.dll file in your built projects plugin folder and then start the game/app, does it load it correctly?

dengbohan commented 5 years ago

it's 64bit I confirmed. I copy he enet.dll to the plugin folder and it works. I find the two dll files are different.

SoftwareGuy commented 5 years ago

Alright, you've just confirmed a bug - my Windows DLL is faulty. I will make a patch release for both Mirror 2017 and 2018 in the coming days. For now, please use that enet.dll from the Failsafe archive - just replace the Redist/Windows/enet.dll file with the one from the Failsafe archive. From there you should always get a working DLL in your builds.

dengbohan commented 5 years ago

Thanks again!

SoftwareGuy commented 5 years ago

No worries. Thanks for reporting the bug!

SoftwareGuy commented 5 years ago

Could you please test this Windows DLL for me? Just replace the "enet.dll" with this one.

This is a custom built DLL that was compiled using MingW64 toolchain on Ubuntu. It's a little "fatter" (410KB) than the failsafe version, but it includes LZ4 compression. I've tested it here locally on my workstation and a Atom-powered Windows 10 machine and had no DllNotFound exceptions.

enet-mingw64-custom.zip

dengbohan commented 5 years ago

It works on both ryzen desktop and core 4700mq laptop, no DLLNotFound exception.

SoftwareGuy commented 5 years ago

Excellent. I'll close this issue ticket, if you get those errors again please let me know. The DLL has also been updated in the repo for future versions of Ignorance.