Boost C++ Libraries: Ticket #4902: strange auto_link behaviour with --layout=system & defined BOOST_AUTO_LINK_NOMANGLE under vc9.0 https://svn.boost.org/trac10/ticket/4902 <p> Env: Visual Studio 9.0.30729.1 SP Boost built with --layout=system </p> <p> in user code: </p> <pre class="wiki">#define BOOST_AUTO_LINK_NOMANGLE 1 #define BOOST_LIB_DIAGNOSTIC #include &lt;boost/filesystem.hpp&gt; </pre><p> in auto_link.hpp I made a little change in pragma message to clarify what happens: </p> <pre class="wiki">#ifdef BOOST_AUTO_LINK_TAGGED # pragma commentcomment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib") # ifdef BOOST_LIB_DIAGNOSTIC # pragma message ("Linking to lib file(1): " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib") # endif #elif defined(BOOST_AUTO_LINK_NOMANGLE) # pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") # ifdef BOOST_LIB_DIAGNOSTIC # pragma message ("Linking to lib file(2): " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") # endif #else # pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib") # ifdef BOOST_LIB_DIAGNOSTIC # pragma message ("Linking to lib file(3): " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib") # endif #endif </pre><p> then I get the compiler output: </p> <pre class="wiki">1&gt;Linking to lib file(2): boost_filesystem.lib 1&gt;Linking to lib file(3): libboost_system-vc90-mt-gd-1_44.lib </pre><p> Looks like the "else" preprocessor section is executed. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4902 Trac 1.4.3 kopylov@… Mon, 29 Nov 2010 09:37:59 GMT <link>https://svn.boost.org/trac10/ticket/4902#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4902#comment:1</guid> <description> <p> I see that auto_link.hpp is included 2 or more times, and BOOST_AUTO_LINK_NOMANGLE is undefined after first call. I wonder for what reason? Is it the possible solution to comment out #undef BOOST_AUTO_LINK_NOMANGLE ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Mon, 29 Nov 2010 15:51:17 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/4902#comment:2 https://svn.boost.org/trac10/ticket/4902#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Beman Dawes</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">filesystem</span> </li> </ul> Ticket John Maddock Tue, 30 Nov 2010 18:01:57 GMT <link>https://svn.boost.org/trac10/ticket/4902#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4902#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/66906" title="Don't undef BOOST_AUTO_LINK_NOMANGLE. Refs #4902.">[66906]</a>) Don't undef BOOST_AUTO_LINK_NOMANGLE. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4902" title="#4902: Bugs: strange auto_link behaviour with --layout=system &amp; defined ... (closed: fixed)">#4902</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 30 Nov 2010 18:04:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4902#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4902#comment:4</guid> <description> <p> This is my mistake, BOOST_AUTO_LINK_NOMANGLE should not get #undef'ed by auto_link.hpp. Now fixed in Trunk. </p> <p> John. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Beman Dawes</dc:creator> <pubDate>Wed, 01 Dec 2010 13:57:27 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4902#comment:5 https://svn.boost.org/trac10/ticket/4902#comment:5 <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> Ticket