Boost C++ Libraries: Ticket #12387: automatic lib link https://svn.boost.org/trac10/ticket/12387 <p> Hi, When I include a header of a class which uses boost::log library after the line "#define X 0" the compilation of this module freezes! (never ending) </p> <p> I use Visual Studio 2015 c++ (ansi-c++ and boost). </p> <p> the lines I included were: #include &lt;boost/log/trivial.hpp&gt; #include &lt;boost/log/sources/severity_logger.hpp&gt; #include &lt;boost/log/sources/record_ostream.hpp&gt; </p> <p> Thanks, Boaz. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12387 Trac 1.4.3 Andrey Semashev Wed, 10 Aug 2016 11:56:08 GMT <link>https://svn.boost.org/trac10/ticket/12387#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12387#comment:1</guid> <description> <p> I can't reproduce this with the latest develop branch. My MSVC version is 19.00.24210 and the test code compiles and links fine: </p> <pre class="wiki">#include &lt;boost/log/trivial.hpp&gt; #include &lt;boost/log/sources/severity_logger.hpp&gt; #include &lt;boost/log/sources/record_ostream.hpp&gt; #define X 0 int main() { return 0; } </pre><p> The command line is: </p> <pre class="wiki">cl -I. /EHsc /MD -D_DEBUG test_vc14_hang.cpp /link /LIBPATH:stage/lib </pre><p> If you can reproduce this with the develop branch from git then please provide the source code and compiler command line to reproduce. Also please provide the full compiler version. </p> <p> Lastly, I suggest you report this to Microsoft as hanging compiler is certainly a compiler bug. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 10 Aug 2016 12:10:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12387#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12387#comment:2</guid> <description> <p> Pls. put the define before the includes... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Wed, 10 Aug 2016 12:26:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12387#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12387#comment:3</guid> <description> <p> That makes compilation to fail because <code>X</code> is used as a template parameter in <code>boost::shared_ptr</code> implementation. No compiler hang. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 10 Aug 2016 13:47:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12387#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12387#comment:4</guid> <description> <p> You are right... defining X just gave a rightful error, the hang happened when I have put before the includes: #define X 0 #define Y 1 </p> <p> this happened even in the compilation before the link </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 10 Aug 2016 13:50:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12387#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12387#comment:5</guid> <description> <p> I work with Visual Studio 2015 with the default toolset v140 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Wed, 10 Aug 2016 15:19:38 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/12387#comment:6 https://svn.boost.org/trac10/ticket/12387#comment:6 <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">wontfix</span> </li> </ul> <p> With two defines the compiler outputs errors and then hangs. </p> <p> I'm sorry, but I don't think I will be able to work around it in the library, especially given that the test code is not supposed to compile in the first place. I suggest you report this to Microsoft so that they fix the compiler hang. </p> Ticket boaz.barnea@… Wed, 10 Aug 2016 17:47:33 GMT <link>https://svn.boost.org/trac10/ticket/12387#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12387#comment:7</guid> <description> <p> Thanks for looking into it. BTW I checked on my mac as well and the compiler doesn't hang, so I agree it's probably MS issue. </p> </description> <category>Ticket</category> </item> </channel> </rss>