2

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)'

Here you can see the Settings and Path of the dll: Here you can see the Settings and Path of the dll

1 Answer 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.