无法将 WinRT/C++ 组件加载到我的 UWP/C# 应用程序

问题描述

我需要将 WebRTC c++ 库包装到 WinRT 组件中,并在我的 UWP/C# 应用程序中使用它。 有一篇很好的文章 how to use native c++ in uwp 描述了我遵循的所有集成步骤。 简而言之:

  • 我已经创建了 Dll/C++ DLL1 库并链接了我的静态库 libwebrtc_full.a。拨打了所有必要的电话
  • 然后,我在我的 WinRT/C++ 项目 WindowsRuntimeComponent1 中引用了 DLL 并成功创建了公共引用类 MyClass,它从 DLL1 进行了所有必要的调用
  • 我的 UWP 应用 App1 正确地看到了 MyClass 及其公共方法App1 引用了 WindowsRuntimeComponent。

在运行应用程序时,只要我尝试使用 WindowsRuntimeComponent1 中实现的类之一,我就会收到运行时异常

The specified module Could not be found.
(Exception from HRESULT: 0x8007007E)

我创建并上传一个示例项目以将我的问题重现到 GDrive 我也在示例项目中包含了我的静态 libwebrtc.a,以防它是问题的根本原因。

我已经解决了关于 SO 的类似问题,与我的问题最相似的是这个 one。不同的是,我引用了这个项目,仍然得到同样的异常。

EDIT1:

这就是 MyClass 的样子:

namespace WindowsRuntimeComponent1
{
    public ref class MyClass sealed
    {
    public:
        MyClass(int sampleRate);
        virtual ~MyClass();

        void ProcessFrame(const Platform::Array<short>^ mic,const Platform::Array<short>^ speaker,const Platform::Array<short>^ output);

    private:
        void* p;
    };
}

EDIT2: 我按照评论中的建议运行了 gflags App1.exe +sls,但我没有看到缺少什么依赖项。下面是带有堆栈跟踪的屏幕截图:

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)