0

I have imported a DLL into Unity, and I am confident it has imported successfully. I have defined a function on the DLL for Unity to use, however whenever it is called, Unity throws me a:

DllNotFoundException: k8055d.dll

The DLL's function is defined through

[DllImport("k8055d")]
public static extern int Version();

and I get the error when this line is run:

Debug.Log (Version().ToString());

The reason I know it has found the DLL is that if I set the DLL to use both x64 and x86 architectures within the import settings, I get this error:

Failed to load 'Assets/Plugins/k8055d.dll', expected 64 bit architecture (IMAGE_FILE_MACHINE_AMD64), but was IMAGE_FILE_MACHINE_I386. You must recompile your plugin for 64 bit architecture.

But this error disappears when I set it to only use an x86 architecture within the import settings, the console just gives the DLLNotFoundException.

Information about the DLL can be found here.

Micah De Silva
  • 45
  • 1
  • 1
  • 6

1 Answers1

0

First google result for IMAGE_FILE_MACHINE_I386. You must recompile your plugin for 64 bit architecture. tells you to try to install and use the 32-bit version of Unity (Editor) to work with your 32 bit dll (right here). Googling a second time for your specific dll ("K8055D.DLL x64") brings up a forum post where some people compiled your dll for x64 (here, direct downloadlink here) and also interesting stuff going on here. Hope this gives you some pointers.

Maximilian Gerhardt
  • 5,188
  • 3
  • 28
  • 61