In my unity project I have 2 versions of my custom DLL, one for x86 and the other for ARM64 (for unity editor and target device respectively)
The x86 dll works as intended, however when deploying to my ARM64 device (Hololens 2) I get the following error:
DllNotFoundException: Unable to load DLL 'OpenCV_ImageProcessing_ARM64'. Tried the load the following dynamic libraries: Unable to load dynamic library 'OpenCV_ImageProcessing_ARM64' because of 'Failed to open the requested dynamic library (0x06000000) - The specified module could not be found. (WinError:0000007e) at InspectionMenu.processCrack (UnityEngine.Color32[]& raw, System.Int32 width, System.Int32 height) [0x00000] in <00000000000000000000000000000000>:0 at InspectionMenu.Update () [0x00000] in <00000000000000000000000000000000>:0
The DLLs are imported depending on which system is running, this works as intended.
#if UNITY_EDITOR
[DllImport("CrackDetection")]
public static extern void processCrack(ref Color32[] raw, int width, int height);
#else
[DllImport("OpenCV_ImageProcessing_ARM64")]
public static extern void processCrack(ref Color32[] raw, int width, int height);
#endif
I have both DLLs located in the Assets/Plugins
folder and the names are correct. I've looked into the possibility of other dependencies of the DLLs not being found via Dependencies and added the ARM64 OpenCV DLLs located in the picture below to the same Assets/Plugins
folder but still no luck. I'm not sure if I also need to add MSVCP140.dll
and VCRUNTIME140.dll
but I'm not sure where I would find those.
Figured out the issue, MSVCP140.dll
and VCRUNTIME140.dll
had to be added to the plugins folder, as well as CONCRT140.dll
. These are all files that can be found in visual studio