I'm trying to implement a simple .dll to my Project which will be builded for the HoloLens Augmented Reality Application. I am trying to simply call a function from my C++ .dll to implement an OpenCV Code but on the HoloLens it throws an error shown below.
.dll C++ Code:
extern "C" void __declspec(dllexport) __stdcall test() {
return;
}
Unity C# Code:
internal class OpenCV
{
// Define the functions which can be called from the .dll.
[DllImport("Project1")]
internal static extern void test();
public static void testmeth()
{
test();
}
}
Error when Debugging on HoloLens with Visual Studio:
System.DllNotFoundException: 'Unable to load DLL 'Project1': The specified module could not be found. (Exception from HRESULT: 0x8007007E)'
Problem: The source files of OpenCV which I compiled for x86 and used successfully for my UWP App somehow didn't work for the HoloLens.
Solved: I used the NuGet-Package "OpenCV-HoloLens" for my C++ .dll and copied the .dlls to Unity as well.
User contributions licensed under CC BY-SA 3.0