Hello,

I'm working on a library which implements POSIX functions on top of Windows 
APIs and CRT. I want support configuration to build the library so that it can 
be used by UWP apps. I tried to figure out things myself, but after spending 
hours reading through Microsoft docs I still didn't have answers I wanted.

First think I wanted to know - are Windows Store apps and UWP apps the same 
thing? They conclusion I came to - Windows Store apps may be UWP apps, but do 
not have to. The only useful bit of information I was able to find is that back 
in Windows 8*, Windows Store apps required to be packaged apps, but it seems 
that now Windows Store allows unpackaged apps as well.

Another question is whether linking against windowsapp.lib (-lwindowsapp) is 
required when building for UWP? The only mention of windowsapp.lib I could find 
in Microsoft docs is this[1]. If I understand correctly, windowsapp.lib exports 
all symbols available to UWP apps, so in theory, if I accidentally reference a 
symbol which is not available to UWP apps, I will get a link error due to 
undefined reference?

Most important question - how do actually build for UWP, does it require 
anything special? With MSVC, at first, I thought that /ZW[2] option would be 
required, but it seems I was mistaken as this option is used to compile C++/CX 
code. Currently, I just link with windowsapp.lib and define WINAPI_FAMILY 
macro. This at least allows to verify that this configuration builds. I feel 
like I must be missing something, or is that it?

The last question - when you need to use mingw-w64's winstorecompat and 
windowsappcompat libraries? Do I understand correctly that they just provide 
stubs for functions which are not available to Windows Store and UWP apps? 
Also, do I understand correctly that you need to use winstorecompat if you 
build Windows 8* Store app and use windowsappcompat when build UWP app?

I think we could add a README file to mingw-w64-libraries/winstorecompat 
subdirectory with some basic information on using winstorecompat and 
windowsappcompat. Currently it just has an empty INSTALL file.

- Kirill Makurin

[1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis
[2] 
https://learn.microsoft.com/en-us/cpp/build/reference/zw-windows-runtime-compilation

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to