Boost C++ Libraries: Ticket #8361: Linking problems with MSVC https://svn.boost.org/trac10/ticket/8361 <p> I've been <a class="ext-link" href="https://sourceforge.net/projects/boost-log/forums/forum/710022/topic/7273262"><span class="icon">​</span>reported</a> a linking issue with MSVC 8 when Boost.Spirit.Karma is used in several translation units of a static library. Apparently, the problem is with some static asserts that generate conflicting symbols in the library. </p> <p> Looking at the boost/spirit/home/support/assert_msg.hpp file and the FAQ, it seems this is a known problem, and defining BOOST_SPIRIT_DONT_USE_MPL_ASSERT_MSG=1 should work around this issue. However, this macro is not defined anywhere in the code which means the user has to discover this problem himself and then look for the solution. It would be better if the library defined the macro automatically for the compilers that are known to be affected by this problem (at least, MSVC 8 for now). </p> <p> As a side note, it might be worthwhile to use BOOST_STATIC_ASSERT_MSG instead of either BOOST_STATIC_ASSERT or BOOST_MPL_ASSERT_MSG whenever static_assert is supported by the compiler. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8361 Trac 1.4.3 Joel de Guzman Tue, 02 Apr 2013 09:38:17 GMT owner changed https://svn.boost.org/trac10/ticket/8361#comment:1 https://svn.boost.org/trac10/ticket/8361#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Joel de Guzman</span> to <span class="trac-author">Hartmut Kaiser</span> </li> </ul> Ticket Hartmut Kaiser Tue, 02 Apr 2013 10:59:39 GMT <link>https://svn.boost.org/trac10/ticket/8361#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8361#comment:2</guid> <description> <p> Do you mind submitting a patch solving this issue? I'd be glad to accept it. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Wed, 03 Apr 2013 08:36:44 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/8361 https://svn.boost.org/trac10/ticket/8361 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">assert_msg.hpp.patch</span> </li> </ul> <p> The patch automatically enables the linking problem workaround and uses static_assret when possible. </p> Ticket Andrey Semashev Wed, 03 Apr 2013 08:41:48 GMT <link>https://svn.boost.org/trac10/ticket/8361#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8361#comment:3</guid> <description> <p> Sorry, I didn't have the chance to verify this patch as I don't have access to MSVC now. </p> <p> One additional note. The patch uses static_assert when BOOST_NO_CXX11_STATIC_ASSERT is not defined, and there seems to be no way to print Types argument into the error message. Due to the way the macro is used, this argument will probably be visible somewhere in the error message backtrace, so I figured there is no need to embed it into the message as well. But you may think otherwise. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Hartmut Kaiser</dc:creator> <pubDate>Wed, 03 Apr 2013 13:13:14 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8361#comment:4 https://svn.boost.org/trac10/ticket/8361#comment:4 <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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/83738" title="Spirit: fix #8361: Linking problems with MSVC">[83738]</a>) Spirit: fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8361" title="#8361: Bugs: Linking problems with MSVC (closed: fixed)">#8361</a>: Linking problems with MSVC </p> Ticket