Boost C++ Libraries: Ticket #2906: boost 1.33.1: build of boost::program_options failed with msvc7.1 and stlport5.0 https://svn.boost.org/trac10/ticket/2906 <p> Some time ago I used msvc 7.1 + stlport 4.6.2 + boost 1.33.1. Everything worked fine. Now I need a STLPort 5.0. I have installed Stlport 5.0 and built them. Afterwards I have rebuilt the boost with STLport 5.0 using following commands: set STLPORT_PATH="some_real_patch_to_stl" set STLPORT_VERSION=5.0 bjam -a "-sTOOLS=vc-7_1-stlport" "-sBUILD=debug release" stage </p> <p> After the build I have noticed that boost::program_options failed to build for dynamic target. I have tried to rebuilt dynamic configuration with following command: bjam "-sTOOLS=vc-7_1-stlport" "-sBUILD=debug release &lt;runtime-link&gt;dynamic" stage </p> <p> In the output following error message has been printed: <em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em> </em></p> <blockquote> <p> D:\TMP\SDK\boost_1_33_1\boost\program_options\variables_map.hpp(142) : s </p> </blockquote> <p> ee reference to class template instantiation 'stlpd_std::map&lt;_Key,_Tp&gt;' being co mpiled </p> <blockquote> <p> with [ </p> <blockquote> <p> _Key=stlpd_std::string, _Tp=boost::program_options::variable_value </p> </blockquote> <p> ] </p> </blockquote> <blockquote> <p> "cl" /Zm800 -nologo /EHsc -c -DBOOST_ALL_DYN_LINK=1 -D_STLP_DEBUG=1 -D_STLP_DEBUG_UNINITIALIZED=1 -D_STLP_USE_DYNAMIC_LIB=1 /Z7 /Od /Ob0 /EHsc /GR /MDd /Op /wd4675 /Zc:forScope -I"bin\boost\libs\program_options\build" -I"D:\TMP\SDK\boo </p> </blockquote> <p> st_1_33_1" -I"D:/TMP/SDK/\STLport-5.0\stlport" -I"D:\TMP\SDK\boost_1_33_1" -Fo" bin\boost\libs\program_options\build\boost_program_options.dll\vc-7_1-stlport\debug\threading-multi\variables_map.obj" -Tp"D:\TMP\SDK\boost_1_33_1\libs\program_options\build\../src/variables_map.cpp" &lt;SKIPPED&gt; vc-C++ bin\boost\libs\program_options\build\boost_program_options.dll\vc-7_1-stlport\release\threading-multi\variables_map.obj variables_map.cpp D:/TMP\SDK\\STLport-5.0\stlport\stl\_tree.h(594) : error C2664: 'bool stlp_std::less&lt;_Tp&gt;::operator ()(const _Tp &amp;,const _Tp &amp;) const' : cannot convert parameter 2 from 'stlp_std::map&lt;_Key,_Tp&gt;::value_type' to 'const stlp_std::string &amp;' </p> <blockquote> <p> with [ </p> <blockquote> <p> _Tp=stlp_std::string </p> </blockquote> <p> ] and [ </p> <blockquote> <p> _Key=stlp_std::string, _Tp=boost::program_options::variable_value </p> </blockquote> <p> ] Reason: cannot convert from 'stlp_std::map&lt;_Key,_Tp&gt;::value_type' to 'co </p> </blockquote> <p> nst stlp_std::string' </p> <blockquote> <p> with [ </p> <blockquote> <p> _Key=stlp_std::string, _Tp=boost::program_options::variable_value </p> </blockquote> <p> ] No constructor could take the source type, or constructor overload resolution was ambiguous </p> </blockquote> <p> &lt;SKIPPED&gt; </p> <p> <em></em><em></em><em>End of output </em></p> <p> The dir tree now looks like: </p> <blockquote> <p> Directory of D:\TMP\SDK\boost_1_33_1\bin\boost\libs\program_options\build\boost_program_options.dll\vc-7_1-stlport\release\threading-multi </p> </blockquote> <p> 30.03.2009 15:25 &lt;DIR&gt; . 30.03.2009 15:25 &lt;DIR&gt; .. 03.04.2009 01:26 404 113 cmdline.obj 03.04.2009 01:26 196 909 config_file.obj 03.04.2009 01:26 54 873 convert.obj 03.04.2009 01:26 402 844 options_description.obj 03.04.2009 01:26 488 046 parsers.obj 03.04.2009 01:26 54 994 positional_options.obj 03.04.2009 01:26 11 774 utf8_codecvt_facet.obj 03.04.2009 01:26 237 871 value_semantic.obj 03.04.2009 01:26 282 664 winmain.obj </p> <blockquote> <p> 9 File(s) 2 134 088 bytes 2 Dir(s) 102 982 483 968 bytes free </p> </blockquote> <p> Please note that the same code has been succesfully compiled for static target: </p> <blockquote> <p> Directory of D:\TMP\SDK\boost_1_33_1\bin\boost\libs\program_options\build\libbo </p> </blockquote> <p> ost_program_options.lib\vc-7_1-stlport\release\threading-multi </p> <p> 03.04.2009 02:46 &lt;DIR&gt; . 03.04.2009 02:46 &lt;DIR&gt; .. 03.04.2009 01:25 288 214 cmdline.obj 03.04.2009 01:25 150 139 config_file.obj 03.04.2009 01:25 51 023 convert.obj 03.04.2009 02:46 1 251 libboost_program_options-vc71-mt-p-1_33_1.CMD 03.04.2009 02:46 2 293 986 libboost_program_options-vc71-mt-p-1_33_1.lib 03.04.2009 01:25 258 530 options_description.obj 03.04.2009 01:25 329 811 parsers.obj 03.04.2009 01:25 44 159 positional_options.obj 03.04.2009 01:25 4 836 utf8_codecvt_facet.obj 03.04.2009 01:25 181 627 value_semantic.obj 03.04.2009 02:46 145 073 variables_map.obj 03.04.2009 01:25 84 840 winmain.obj </p> <blockquote> <p> 12 File(s) 3 833 489 bytes </p> <blockquote> <p> 2 Dir(s) 102 982 483 968 bytes free </p> </blockquote> </blockquote> <p> I have tried to update the boost::program_options library from trunk of Boost SVN but the problem is still here. So I assume this issue is not fixed yet. I would very appreciate if there is solution for this issue or may be some workaround. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2906 Trac 1.4.3 nikolay@… Fri, 03 Apr 2009 08:00:29 GMT <link>https://svn.boost.org/trac10/ticket/2906#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2906#comment:1</guid> <description> <p> Forgot to mention: I am using STLPort 5.0 with following user configs: #define _REENTRANT #define _STLP_OWN_IOSTREAMS 1 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Fri, 03 Apr 2009 08:14:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2906#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2906#comment:2</guid> <description> <p> Please provide the complete error message you get with 1.38 -- I need to know the instantiation stack to fix this. </p> </description> <category>Ticket</category> </item> <item> <author>nikolay@…</author> <pubDate>Fri, 03 Apr 2009 10:06:49 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/2906#comment:3 https://svn.boost.org/trac10/ticket/2906#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">nikolay@…</span> added </li> </ul> <p> When I have updated boost::program_options library to latest release I got the same error: vc-C++ bin\boost\libs\program_options\build\boost_program_options.dll\vc-7_1-stlport\release\threading-multi\variables_map.obj variables_map.cpp D:/TMP\SDK\\STLport-5.0\stlport\stl\_tree.h(594) : error C2664: 'bool stlp_std::less&lt;_Tp&gt;::operator ()(const _Tp &amp;,const _Tp &amp;) const' : cannot convert parameter 2 from 'stlp_std::map&lt;_Key,_Tp&gt;::value_type' to 'const stlp_std::string &amp;' </p> <p> with [ </p> <p> _Tp=stlp_std::string </p> <p> ] and [ </p> <p> _Key=stlp_std::string, _Tp=boost::program_options::variable_value </p> <p> ] Reason: cannot convert from 'stlp_std::map&lt;_Key,_Tp&gt;::value_type' to 'co </p> <p> nst stlp_std::string' with [ </p> <p> _Key=stlp_std::string, _Tp=boost::program_options::variable_value </p> <p> ] No constructor could take the source type, or constructor overload resolution was ambiguous. </p> <p> The really interesting thing that static library has been succesfully built. I can find declaration of the variables_map class in the dump of static library: 0152D2E public: <span class="underline">thiscall boost::program_options::variables_map::variables_map(class boost::program_options::abstract_variables_map const *) </span></p> Ticket Vladimir Prus Fri, 03 Apr 2009 10:17:41 GMT <link>https://svn.boost.org/trac10/ticket/2906#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2906#comment:4</guid> <description> <p> The error message you have posted still does not say where the code was instantiated. Are you sure you have posted *complete* error message -- from the very first line in the build log, till the very last? Please attach it to the issue, don't copy-paste. </p> </description> <category>Ticket</category> </item> <item> <author>nikolay@…</author> <pubDate>Fri, 03 Apr 2009 10:26:49 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/2906 https://svn.boost.org/trac10/ticket/2906 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">build_logs.txt</span> </li> </ul> <p> logs of build failure </p> Ticket nikolay@… Sun, 05 Apr 2009 17:47:49 GMT <link>https://svn.boost.org/trac10/ticket/2906#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2906#comment:5</guid> <description> <p> I have downloaded complete boost 1.38.0 and tried to build it. I got the same error: only static libs has been created for the boost::program_options library. I have used following command to build the boost: D:\TMP\SDK\boost_1_38_0&gt;tools\jam\src\bin.ntx86\bjam.exe --build-type=complete - -toolset=msvc stdlib=stlport stage </p> </description> <category>Ticket</category> </item> <item> <author>nikolay@…</author> <pubDate>Sun, 05 Apr 2009 17:50:23 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/2906 https://svn.boost.org/trac10/ticket/2906 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">files.txt</span> </li> </ul> <p> list of libs which are successfully compiled with msvc7.1 and stlport5.0 </p> Ticket nikolay@… Sun, 05 Apr 2009 17:50:53 GMT attachment set https://svn.boost.org/trac10/ticket/2906 https://svn.boost.org/trac10/ticket/2906 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">files.2.txt</span> </li> </ul> <p> list of 1.38.0 libs which are successfully compiled with msvc7.1 and stlport5.0 </p> Ticket nikolay@… Mon, 06 Apr 2009 15:03:07 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2906#comment:6 https://svn.boost.org/trac10/ticket/2906#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">fixed</span> </li> </ul> <p> I think we can close this issue now. I have installed Stlport 5.0.3 and successfully built both boost 1.33.1 and 1.38.0 with msvc 7.1. So the problem was in stlport (5.0.0). </p> Ticket