{"action":"created","issue":{"url":"https://api.github.com/repos/boostorg/build/issues/62","labels_url":"https://api.github.com/repos/boostorg/build/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/boostorg/build/issues/62/comments","events_url":"https://api.github.com/repos/boostorg/build/issues/62/events","html_url":"https://github.com/boostorg/build/pull/62","id":60405609,"number":62,"title":"asio require /ZW","user":{"login":"john-peterson","id":207571,"avatar_url":"https://avatars.githubusercontent.com/u/207571?v=3","gravatar_id":"","url":"https://api.github.com/users/john-peterson","html_url":"https://github.com/john-peterson","followers_url":"https://api.github.com/users/john-peterson/followers","following_url":"https://api.github.com/users/john-peterson/following{/other_user}","gists_url":"https://api.github.com/users/john-peterson/gists{/gist_id}","starred_url":"https://api.github.com/users/john-peterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/john-peterson/subscriptions","organizations_url":"https://api.github.com/users/john-peterson/orgs","repos_url":"https://api.github.com/users/john-peterson/repos","events_url":"https://api.github.com/users/john-peterson/events{/privacy}","received_events_url":"https://api.github.com/users/john-peterson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-09T20:36:26Z","updated_at":"2015-04-14T14:06:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/boostorg/build/pulls/62","html_url":"https://github.com/boostorg/build/pull/62","diff_url":"https://github.com/boostorg/build/pull/62.diff","patch_url":"https://github.com/boostorg/build/pull/62.patch"},"body":"my build command is\r\n\r\n\tgit clone --depth=1 --no-single-branch http://github.com/boostorg/boost.git .\r\n\tgit checkout boost-1.57.0\r\n\tgit submodule update --init\r\n\tcall \"%VS120COMNTOOLS%..\\..\\vc\\vcvarsall.bat\" amd64\r\n\tbootstrap.bat\r\n\tb2 -j8 toolset=msvc-12.0 address-model=64 variant=release,debug link=shared runtime-link=shared windows-api=store\r\n\r\nwithout /ZW there's no Windows namespace or __cplusplus_winrt macro\r\n\r\n>https://msdn.microsoft.com/en-us/library/hh561383.aspx\r\n\r\n>The required metadata files, **namespaces**, data types, and functions that your app requires to execute in the Windows Runtime.\r\n\r\n>http://stackoverflow.com/questions/16698949/how-to-access-namespace-windows\r\n\r\n>In the UI, the /ZW option is listed as \"Consume Windows Runtime Extension\"\r\n\r\n\r\n## asio is written for /ZW\r\n\r\nthere's no /ZW in https://github.com/boostorg/build/blob/develop/src/tools/msvc.jam so both link=shared and link=static are without the Windows namespace and without __cplusplus_winrt. this cause errors like this with both link=shared and link=static\r\n\r\n\tD:\\file\\code\\lib\\boost\\boost/asio/detail/buffer_sequence_adapter.hpp(38) : error C2653: 'Windows' : is not a class or namespace name\r\n\tD:\\file\\code\\lib\\boost\\boost/asio/detail/impl/socket_ops.ipp(2246) : error C2871: 'Collections' : a namespace with this name does not exist\r\n\tD:\\file\\code\\lib\\boost\\boost/asio/detail/impl/socket_ops.ipp(2247) : error C2871: 'Networking' : a namespace with this name does not exist\r\n\r\n\r\n## /ZW is recommended but not necessary for WinRT\r\n\r\nanother solution is to rewrite boostorg/asio to not require /ZW. which would be pointless\r\n\r\nthe Windows namespace can be accessed with an #include instead of with /ZW\r\n\r\n>http://blogs.msdn.com/b/chuckw/archive/2012/09/18/dual-use-coding-techniques-for-games-part-3.aspx\r\n\r\n>It is, however, possible to be building for a Windows Store app without the /ZW switch (such as in a static library), so the #ifndef __cplusplus_winrt case can still be for a Windows Store app.\r\n\r\nQt is an example of a lib that doesn't use /ZW. but their reason (code standard and text editor support) is pointless\r\n\r\n>http://qt-project.org/wiki/WinRT\r\n\r\n>To achieve the best compatibility/consistency with C++ standards as well as support for code editors, only WRL templates [msdn.microsoft.com] should be used when writing platform code for WinRT. No C++/CX extensions should be used.\r\n\r\n>https://github.com/qtproject/qtbase/blob/dev/src/winmain/qtmain_winrt.cpp\r\n\r\n\t#include <wrl.h>\r\n\t#include <Windows.ApplicationModel.core.h>\r\n\r\n\tusing namespace ABI::Windows::ApplicationModel;\r\n\r\n>https://github.com/qtproject/qtbase/search?p=1&q=%2FZW&type=Code&utf8=%E2%9C%93"},"comment":{"url":"https://api.github.com/repos/boostorg/build/issues/comments/92864629","html_url":"https://github.com/boostorg/build/pull/62#issuecomment-92864629","issue_url":"https://api.github.com/repos/boostorg/build/issues/62","id":92864629,"user":{"login":"john-peterson","id":207571,"avatar_url":"https://avatars.githubusercontent.com/u/207571?v=3","gravatar_id":"","url":"https://api.github.com/users/john-peterson","html_url":"https://github.com/john-peterson","followers_url":"https://api.github.com/users/john-peterson/followers","following_url":"https://api.github.com/users/john-peterson/following{/other_user}","gists_url":"https://api.github.com/users/john-peterson/gists{/gist_id}","starred_url":"https://api.github.com/users/john-peterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/john-peterson/subscriptions","organizations_url":"https://api.github.com/users/john-peterson/orgs","repos_url":"https://api.github.com/users/john-peterson/repos","events_url":"https://api.github.com/users/john-peterson/events{/privacy}","received_events_url":"https://api.github.com/users/john-peterson/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T14:06:19Z","updated_at":"2015-04-14T14:06:19Z","body":"there's no clear statement from microsoft. some indirect statements https://www.google.com/search?q=store+apps+compilation+%2Fzw https://github.com/boostorg/build/pull/62#issue-60405609. @chriskohlhoff might know because he wrote a lot of winrt code https://github.com/boostorg/asio/commit/e746865f7882ad29cda8f2bfea10d775839594f5"}}