Boost C++ Libraries: Ticket #13457: Windows port for 1.66.0 incorrectly includes NTVERP.H https://svn.boost.org/trac10/ticket/13457 <p> The Windows file NTVERP.H contains the version information for the SDK, and it must not be included by Boost (specifically, in lib\native\include\boost\predef\platform\windows_uwp.h) because it prevents applications from defining their own version resource, causing the compiler to complain about the version macros being redefined. In projects that are required to use the /WX (treat compiler warnings as errors) this is a fatal error. Previous versions of Boost did not have this problem. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13457 Trac 1.4.3 Brian Catlin <BrianC@…> Wed, 02 May 2018 01:18:56 GMT component changed; owner set https://svn.boost.org/trac10/ticket/13457#comment:1 https://svn.boost.org/trac10/ticket/13457#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Andrey Semashev</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">winapi</span> </li> </ul> Ticket Andrey Semashev Thu, 03 May 2018 01:32:34 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/13457#comment:2 https://svn.boost.org/trac10/ticket/13457#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> The <code>boost/predef/platform/windows_uwp.h</code> header is part of Boost.Predef. Please, report the problem <a class="ext-link" href="https://github.com/boostorg/predef/issues/new"><span class="icon">​</span>here</a>. </p> <p> In my opinion though, you have to define any version macros before including *any* headers, Boost or not. And <code>ntverp.h</code> is essential as it allows Boost to discover Windows SDK version, I see no way around including it. </p> Ticket Brian Catlin <BrianC@…> Thu, 03 May 2018 01:45:09 GMT <link>https://svn.boost.org/trac10/ticket/13457#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13457#comment:3</guid> <description> <p> It is common to share a Version.h header file between resource (.rc) files and source files (.cpp), to give the program access to the version information placed in the executable's version info section. Moving the definitions of the version macros before the header includes solves nothing; the macros are still re-defined because you're including NTVERP.H. Why not check to see if the macros are already defined before including NTVERP.H? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Thu, 03 May 2018 02:05:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13457#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13457#comment:4</guid> <description> <p> Arguably, you're not defining macros like <code>VER_PRODUCTBUILD</code>. You're not supposed to, anyway, because that is the Windows SDK version macro. </p> <p> I'm not sure what version information you mean, but if this is the target Windows version defined by <code>_WIN32_WINNT</code> or the API family defined by <code>WINAPI_FAMILY</code> then defining those in a header is error-prone because it can easily get you into trouble if you mess up include order. </p> </description> <category>Ticket</category> </item> <item> <author>Brian Catlin <BrianC@…></author> <pubDate>Thu, 03 May 2018 02:41:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13457#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13457#comment:5</guid> <description> <p> In File Explorer, when you right-click on an executable and select the details tab, what you see is the version information that was stored in a resource section in the executable. As I mentioned, the most common paradigm is to define the version info in a header file (version.h), which is included by both the resource file (resources.rc) and the cpp file, thus giving the cpp file access to the version info, for outputting in a banner or in response to a -v command. </p> </description> <category>Ticket</category> </item> <item> <author>Brian Catlin <BrianC@…></author> <pubDate>Thu, 03 May 2018 02:47:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13457#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13457#comment:6</guid> <description> <p> How about putting your include of NTVERP.h into its own namespace so that you don't pollute the global namespace? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Thu, 03 May 2018 08:35:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13457#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13457#comment:7</guid> <description> <blockquote class="citation"> <p> In File Explorer, when you right-click on an executable and select the details tab, what you see is the version information that was stored in a resource section in the executable. </p> </blockquote> <p> I don't see how it is related to macros defined in <code>ntverp.h</code>. Which macros must you define in your header that are also defined in <code>ntverp.h</code>? </p> <blockquote class="citation"> <p> How about putting your include of NTVERP.h into its own namespace so that you don't pollute the global namespace? </p> </blockquote> <p> We're talking about macros, they don't respect C++ namespaces. </p> </description> <category>Ticket</category> </item> </channel> </rss>