Opened 14 years ago

Closed 14 years ago

#2906 closed Bugs (fixed)

boost 1.33.1: build of boost::program_options failed with msvc7.1 and stlport5.0

Reported by: nikolay@… Owned by: Vladimir Prus
Milestone: Boost 1.39.0 Component: program_options
Version: Boost 1.38.0 Severity: Problem
Keywords: program_options dynamic stlport5 build error Cc: nikolay@…

Description

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

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 <runtime-link>dynamic" stage

In the output following error message has been printed:

D:\TMP\SDK\boost_1_33_1\boost\program_options\variables_map.hpp(142) : s

ee reference to class template instantiation 'stlpd_std::map<_Key,_Tp>' being co mpiled

with [

_Key=stlpd_std::string, _Tp=boost::program_options::variable_value

]

"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

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" <SKIPPED> 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<_Tp>::operator ()(const _Tp &,const _Tp &) const' : cannot convert parameter 2 from 'stlp_std::map<_Key,_Tp>::value_type' to 'const stlp_std::string &'

with [

_Tp=stlp_std::string

] and [

_Key=stlp_std::string, _Tp=boost::program_options::variable_value

] Reason: cannot convert from 'stlp_std::map<_Key,_Tp>::value_type' to 'co

nst stlp_std::string'

with [

_Key=stlp_std::string, _Tp=boost::program_options::variable_value

] No constructor could take the source type, or constructor overload resolution was ambiguous

<SKIPPED>

End of output

The dir tree now looks like:

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

30.03.2009 15:25 <DIR> . 30.03.2009 15:25 <DIR> .. 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

9 File(s) 2 134 088 bytes 2 Dir(s) 102 982 483 968 bytes free

Please note that the same code has been succesfully compiled for static target:

Directory of D:\TMP\SDK\boost_1_33_1\bin\boost\libs\program_options\build\libbo

ost_program_options.lib\vc-7_1-stlport\release\threading-multi

03.04.2009 02:46 <DIR> . 03.04.2009 02:46 <DIR> .. 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

12 File(s) 3 833 489 bytes

2 Dir(s) 102 982 483 968 bytes free

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.

Attachments (3)

build_logs.txt (19.0 KB ) - added by nikolay@… 14 years ago.
logs of build failure
files.txt (19.1 KB ) - added by nikolay@… 14 years ago.
list of libs which are successfully compiled with msvc7.1 and stlport5.0
files.2.txt (19.1 KB ) - added by nikolay@… 14 years ago.
list of 1.38.0 libs which are successfully compiled with msvc7.1 and stlport5.0

Download all attachments as: .zip

Change History (9)

comment:1 by nikolay@…, 14 years ago

Forgot to mention: I am using STLPort 5.0 with following user configs: #define _REENTRANT #define _STLP_OWN_IOSTREAMS 1

comment:2 by Vladimir Prus, 14 years ago

Please provide the complete error message you get with 1.38 -- I need to know the instantiation stack to fix this.

comment:3 by nikolay@…, 14 years ago

Cc: nikolay@… added

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<_Tp>::operator ()(const _Tp &,const _Tp &) const' : cannot convert parameter 2 from 'stlp_std::map<_Key,_Tp>::value_type' to 'const stlp_std::string &'

with [

_Tp=stlp_std::string

] and [

_Key=stlp_std::string, _Tp=boost::program_options::variable_value

] Reason: cannot convert from 'stlp_std::map<_Key,_Tp>::value_type' to 'co

nst stlp_std::string' with [

_Key=stlp_std::string, _Tp=boost::program_options::variable_value

] No constructor could take the source type, or constructor overload resolution was ambiguous.

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: thiscall boost::program_options::variables_map::variables_map(class boost::program_options::abstract_variables_map const *)

comment:4 by Vladimir Prus, 14 years ago

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.

by nikolay@…, 14 years ago

Attachment: build_logs.txt added

logs of build failure

comment:5 by nikolay@…, 14 years ago

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>tools\jam\src\bin.ntx86\bjam.exe --build-type=complete - -toolset=msvc stdlib=stlport stage

by nikolay@…, 14 years ago

Attachment: files.txt added

list of libs which are successfully compiled with msvc7.1 and stlport5.0

by nikolay@…, 14 years ago

Attachment: files.2.txt added

list of 1.38.0 libs which are successfully compiled with msvc7.1 and stlport5.0

comment:6 by nikolay@…, 14 years ago

Resolution: fixed
Status: newclosed

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).

Note: See TracTickets for help on using tickets.