繁体   English   中英

在 Hololens 上的 C# Unity 中找不到模块 C++ .dll

[英]Module not found C++ .dll inside C# Unity on Hololens

我正在尝试为我的项目实现一个简单的 .dll,该项目将为 HoloLens 增强现实应用程序构建。 我试图简单地从我的 C++ .dll 调用一个函数来实现一个 OpenCV 代码,但在 HoloLens 上它会引发如下所示的错误。

.dll C++ 代码:

extern "C" void __declspec(dllexport) __stdcall test() {
    return;
}

统一 C# 代码:

 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();
        }
    }

使用 Visual Studio 在 HoloLens 上调试时出错:

System.DllNotFoundException: 'Unable to load DLL 'Project1': The specified module could not be found. (Exception from HRESULT: 0x8007007E)'

在这里你可以看到dll的设置和路径: 在这里可以看到dll的设置和路径

问题:我为 x86 编译并成功用于我的 UWP 应用程序的 OpenCV 源文件不知何故不适用于 HoloLens。

已解决:我将 NuGet 包“OpenCV-HoloLens”用于我的 C++ .dll 并将 .dll 复制到 Unity。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM