Boost C++ Libraries: Ticket #4349: Autolinking against debug STLport https://svn.boost.org/trac10/ticket/4349 <p> I can't use autolinking with the following setup: </p> <ul><li>using a debug build </li><li>using STLport </li><li>not using additional checks and diagnostics (_STLP_DEBUG) </li></ul><p> The autolinking code should simply look for the "dp" variant of the Boost libraries. What I get is a warning that these libs are not built by default. Even worse, I get an error downright refusing to link with that version, even though I did compile them. However, that error is still better than nothing, because the macros defining the version are then set to "gdp" which is simply incompatible with my settings. </p> <p> Things to fix: </p> <ul><li>Fix the generated tags, i.e. replace "gdp" with "dp" for above example. </li><li>Don't generate an error when using STLport with debug symbols but without additional diagnostic. </li></ul><p> Further things that could be fixed, too: </p> <ul><li>Don't output a warning unless lib diagnostics (BOOST_LIB_DIAGNOSTIC) are actually requested. </li><li>Document the meaning of an 'n' in the generated tag. </li><li>Remove redundant comment documenting the 'p' in the generated tag. </li><li>Fix spelling of STLport here, without a capital P. </li><li>Fix warnings, those claim that you should use "/D_STLP_DEBUG=1", but a simple "/D_STLP_DEBUG" is sufficient. A short grep shows that several other parts of Boost also have this, maybe creating separate ticket and patch would be a better choice for this. </li><li>Fix indention of preprocessor commands, large parts use 3 spaces, some parts use 4. </li></ul><p> Concerning the version, this bug is present in today's trunk, 1.43 and 1.33.1, which are also all versions I checked. Concerning 1.33.1, we are using a local version where this discrepancy is fixed and have not found any problems with it. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4349 Trac 1.4.3 eckhardt@… Wed, 16 Jun 2010 10:58:21 GMT attachment set https://svn.boost.org/trac10/ticket/4349 https://svn.boost.org/trac10/ticket/4349 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-trunk-autolinking.0.patch</span> </li> </ul> <p> patch against trunk </p> Ticket John Maddock Sat, 24 Jul 2010 17:15:27 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4349#comment:1 https://svn.boost.org/trac10/ticket/4349#comment:1 <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> Unfortunately your patch would break a lot of other things, and in general this is actually unfixable. </p> <p> Assuming you built with something like: </p> <p> bjam stdlib=stlport runtime-debugging=off </p> <p> Then you do indeed get libraries with a -dp suffix. Note however that these would have been built with the /MD compiler option and linked against stlport-5.2.lib and not against the debug libraries (stlportd-5.2.lib) which would require building with /MDd - this latter option is simply not supported by Boost.Build as far as I can see, which is why the auto-linking code gives the error message it does. </p> <p> Now here's the issue - the libraries built with a -dp suffix can only be safely used if your code is also built with /MD and does not define _DEBUG (since the latter is used by MS to indicate the /MDd compiler option). In other words there is no way to select the "correct" -dp libraries in this case, although it will select a different -p variant without debugging info that is binary compatible with /MD. </p> <p> To get the error message that you did, I assume that you built your code with /MDd which will produce an error - and quite right too - as there is no way for Boost.Build to create those binaries (/MDd without _STLP_DEBUG). Further, building with /MDd and linking against -dp binaries is actually dangerous, as you're linking code built with two different MSVC runtimes, and two different STLport binaries. </p> <p> Anyway, I hope I've got that all correct - this is fiendishly complex to figure out which is why we created auto_link.hpp in the first place! </p> Ticket Ulrich Eckhardt Sun, 25 Jul 2010 06:42:12 GMT <link>https://svn.boost.org/trac10/ticket/4349#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4349#comment:2</guid> <description> <p> I guess my misunderstanding was that there are 'd' and 'g', which mean the same thing but one for the program being built and the other for the support libraries it uses. What I thought was that the 'g' was only intended to activate additional diagnostics (checked iterators etc). Looking at the <a href="http://www.boost.org/doc/libs/1_43_0/more/getting_started/windows.html">docs</a> for this makes it a bit clearer, even though these docs refer to an undocumented 'n' flag in the example, too. How about something like this concerning the documentation </p> <ul><li>g debug/diagnostic runtime libraries (release if not present). </li><li>y debug/diagnostic Python runtime (release if not present). </li><li>d debug/diagnostic build (release if not present). </li></ul><p> The above makes clearer that the three all control the same thing but for separate parts of the code. </p> <p> What I'm wondering though is why that separation exists. I personally haven't seen the need to use different settings for the program being built and the libraries it links. Worse, MSVC assumes you don't want to do that either. What I do want now and then is to disable additional diagnostics, because those tend to slow down things a lot, especially on remotely-debugged embedded targets, which is what I work with most. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sun, 25 Jul 2010 09:58:26 GMT</pubDate> <title>status, component changed; resolution deleted https://svn.boost.org/trac10/ticket/4349#comment:3 https://svn.boost.org/trac10/ticket/4349#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">invalid</span> </li> <li><strong>component</strong> <span class="trac-field-old">config</span> → <span class="trac-field-new">Getting Started Guide</span> </li> </ul> <p> You're correct that for msvc the g and d options should always be used together, however, Boost.Build is compiler and platform independent, and for some compilers there is a clear separation between these two. Others simply don't have a notion of "runtime-debugging" and so the g option is never used. </p> <p> Reassigning to the getting started guide maintainers... </p> Ticket John Maddock Sun, 25 Jul 2010 09:58:56 GMT owner, status changed https://svn.boost.org/trac10/ticket/4349#comment:4 https://svn.boost.org/trac10/ticket/4349#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">John Maddock</span> to <span class="trac-author">Dave Abrahams</span> </li> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">new</span> </li> </ul> Ticket