ERROR: Client exited with error code: -1073740791

I am trying to package a basic project (mostly empty) and when I try to integrate a static library, it cannot Launch after the packaging completes. The error I see is: ERROR: Client exited with error code: -1073740791

What’s interesting is I had to deactivate a WebM Video plugin (from Epic, marked beta) to even get it to compile during packaging. If the plugin was activated then linking fails during the compilation/build step:
vpxmd.lib(vpx_src_vpx_codec.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
fatal error C1047: The object or library file 'C:\Program Files\Epic Games\UE_4.21\Engine\Plugins\Media\WebMMedia\Source\ThirdParty\libWebM\libvpx\lib\Win64\VS2015\vpxmd.lib' was created with an older compiler than other objects; rebuild old objects and libraries
LINK : fatal error LNK1257: code generation failed

The static library I’m using is built from a Windows UWP static library project from VS 2017 (C++), where I have Consume Windows Runtime Extension on (Yes /ZW), as it’s the only way to get access to the Windows 10 Bluetooth LE driverstack. To note, it also has /MD (Multithreaded DLL) for RuntimeLibrary set.

What’s interesting is everything works as expected in the editor, and the static library and bluetooth functionality is functioning without error. Furthermore, I do see traces of webm in the shipping log, in regards to CreateIntermediateTextFile.

Why does my library work within the editor and not during this packaging phase?

== UPDATE ==

The error was in regards to WinRT not being CoInitialized.
I found that by definingMicrosoft::WRL::Wrappers::RoInitializeWrapper initialize(RO_INIT_MULTITHREADED); globally in the thread, I could get this to run up to the splash screen, but then crashes with an exit code of 1, unknown error. I’m going to remake the static library as a dynamic one and see if that makes any sort of difference.

== UPDATE 2 ==
I rebuilt this as a DLL, it works now.

By turning off “Whole Program Optimization” on the static lib’s compilation process, I could build with this webm plugin; but the exit code still remains.