Cant load WinRT/C++ component to my UWP/C# application

441 Views Asked by At

I need to wrap WebRTC c++ library into WinRT component and use it from my UWP/C# application. There is a good article how to use native c++ in uwp which describes all the integration steps, which I followed. Briefly:

  • I have created Dll/C++ DLL1 library and linked my static library libwebrtc_full.a. Made all necessary calls
  • Then, I referenced the DLL in my WinRT/C++ project WindowsRuntimeComponent1 and created public ref class MyClass successfully which makes all the necessary calls from DLL1
  • My UWP app App1 sees MyClass correctly and its public methods, App1 has reference to the WindowsRuntimeComponent.

When it comes to run the application, I am getting runtime exception as soon as I try to use one of the classes implemented in WindowsRuntimeComponent1

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

I created and uploaded a sample project to reproduce my problem to GDrive I included my static libwebrtc.a as well in the sample project in case if its the root cause of the problem.

I already went through the similar questions on SO and most similar to my problem is this one. The difference is that I am referencing the project and still get the same exception.

EDIT1:

This is how MyClass looks like:

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: I ran gflags App1.exe +sls as suggested in the comments, but I dont see what dependency is missing. Below is the screenshot with stack trace:

enter image description here

0

There are 0 best solutions below