我想实现一个简单的.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)'
问题:这是我编的x86和我UWP应用成功地使用某种方式为HoloLens没有工作的OpenCV的源文件。
解决:我用的NuGet-包“的OpenCV-HoloLens”我的C ++ .dll和复制的.dll以团结为好。