Can Windows Store applications be built with Mingw? Can Windows Store applications be built with Mingw? c c

Can Windows Store applications be built with Mingw?


You would need to use the Windows Runtime C++ Template Library (WRL) directly, you wouldn't be able to use C++/CX as Mingw doesn't support it. Other than that, I think you just need the Windows 8 SDK, then you need to configure Mingw to use the headers and libraries. Also, you won't be able to use XAML to describe your user interface, you'll have to manually create your UI in code.

Rather than attempt to write the entire application with mingw and cross compile it with linux, you can write your core libraries with mingw, then write a simple UI wrapper over the libraries using Visual Studio Express (free). That way you can use all the nice stuff like XAML and ref-counted instances.

This is the approach I have taken - using libraries written in C++, and then a separate UI project (using XAML) which references the other libraries. It works well.


MinGW-w64 has experimental support of UWP C runtime distributed with VS2013. C dlls linked with universal VS2013 crt are also can be used with VS2015 and VS2017 UWP toolchains ( UWP project should has "Microsoft Visual C++ 2013 Runtime Package for Windows Universal" as dependency).
MinGW-w64 provides winstorecompat library to replace some forbidden API calls on UWP platform with user defined implementation. winstorecompat should be linked to user's library before linking with system libraries.
Also it's required to build MinGW C dll with custom flag -Wl,--dynamicbase to pass Windows 10 Store Certification Kit security checks and also set appcontainer bit flag to be compatible with Windows 10 Store binary requriements.
Here it's link to sample project I've worked on how to consume plain C MinGW Dll into Windows 10 C# UWP application, PInvoke methods from C dll and pass Certification Kit security checks to be published in Windows Store. I've referenced libVLC WinRT build implementation.


Take a look at using C++/WinRT with clang compiler instead of MinGW:

https://github.com/Microsoft/cppwinrt
https://moderncpp.com/

"C++/WinRT is a standard C++ language projection for the Windows Runtime implemented solely in header files. It allows you to both author and consume Windows Runtime APIs using any standards-compliant C++ compiler."

"C++/WinRT relies on C++17 language features and as such you need to tell C++ that your project requires the C++17 language standard."

"While Visual C++ continues to be our primary target, we use Clang as our secondary compiler to ensure standard conformance. Many small changes have been made in this update to support Clang builds and to fix correctness bugs that were only found with Clang builds."