[program_options] [msvc 2010] 1.34.1: Error when compiling

Hello,
I got hands on the Visual Studio 2010 Beta 1 and had to rebuild the 1.34.1
version of boost libraries I use in my project with the new VC 10 compiler.
Thread, Test, IOStreams, Filesystem built fine, but program_options failed.
Let me first clarify why I do need 1.34.1: This is the version that is most
available on Linux servers (including the one I develop for), so I need this
version on my development box to ensure source code compatibility, even
though this version does not officially support even VC 9 (which however
builds it fine and I happily use it).
Below I list the errors that happened with the VC 10 compiler. I aggregated
them to 3 issues. For multiple occurences of issue 1., I only copy/paste the
full output for the first occurence.
I would welcome if someone could tell me if these are the new compiler's
fault, or not. If they are, I plan to report them on MS Connect so that they
can hopefully get fixed before next Beta (or at least before the RTM).
1. C2668: 'boost::bind' : ambiguous call to overloaded function
========================================
Happens here:
libs\program_options\src\cmdline.cpp(198)
libs\program_options\src\cmdline.cpp(202)
libs\program_options\src\cmdline.cpp(206)
libs\program_options\src\cmdline.cpp(210)
libs\program_options\src\cmdline.cpp(213)
libs\program_options\src\cmdline.cpp(215)
libs\program_options\src\parsers.cpp(73)
For the first occurence (cmdline.cpp(198)), the message states these further
details (I checked the boost::bind vs. std::tr1::bind is listed in all 7
occurences):
C:\Documents and Settings\Boris\My
Documents\Downloads\boost_1_34_1\boost/bind/bind_mf_cc.hpp(43): could be
'boost::_bi::bind_t

Boris Dušek wrote:
Hello, I got hands on the Visual Studio 2010 Beta 1 and had to rebuild the 1.34.1 version of boost libraries I use in my project with the new VC 10 compiler. Thread, Test, IOStreams, Filesystem built fine, but program_options failed.
Let me first clarify why I do need 1.34.1: This is the version that is most available on Linux servers (including the one I develop for), so I need this version on my development box to ensure source code compatibility, even though this version does not officially support even VC 9 (which however builds it fine and I happily use it).
Below I list the errors that happened with the VC 10 compiler. I aggregated them to 3 issues. For multiple occurences of issue 1., I only copy/paste the full output for the first occurence.
I would welcome if someone could tell me if these are the new compiler's fault, or not. If they are, I plan to report them on MS Connect so that they can hopefully get fixed before next Beta (or at least before the RTM).
1. C2668: 'boost::bind' : ambiguous call to overloaded function
See https://svn.boost.org/trac/boost/changeset/53700
2. Deduction of template parameters for std::transform (C2780, C2784) ================================================= libs\program_options\src\parsers.cpp(73) : error C2780: '_OutTy *std::transform(_InIt1,_InIt1,_InTy (&)[_InSize],_OutTy (&)[_OutSize],_Fn2)' : expects 5 arguments - 4 provided C:\Program Files\Microsoft Visual Studio
I have no idea about this.
3. cannot convert from 'std::_Tree_const_iterator<_Mytree>' to 'std::_Tree_iterator<_Mytree> ================================================================= C:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\map(258) : error C2440: 'initializing' : cannot convert from 'std::_Tree_const_iterator<_Mytree>' to 'std::_Tree_iterator<_Mytree>' with [
_Mytree=std::_Tree_val std::string,boost::program_options::variable_value>>,false>>
]
No constructor could take the source type, or constructor overload
resolution was ambiguous
C:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\map(257) :
while compiling class template member function 'const
boost::program_options::variable_value &std::map<_Kty,_Ty>::at(const
std::basic_string<_Elem,_Traits,_Ax> &) const'
with
[
_Kty=std::string,
_Ty=boost::program_options::variable_value,
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
C:\Documents and Settings\Boris\My
Documents\Downloads\boost_1_34_1\boost/program_options/variables_map.hpp(139) No idea; there are no changes in that file that might have fixed anything
like that.
- Volodya

Hello Volodya,
1. C2668: 'boost::bind' : ambiguous call to overloaded function
It turned out this one not only fixes 1., but contains pointers for issues 2. and 3. as well: 2. - I had to #include <iterator>, and then also explicitly quality bind to boost::bind on the same line. Problem solved. 3. - It's a bug with a MS Connect report linked there. Problem "solved" :-) Thank you! Boris

(3) is a bug in VC10 - see https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feedba... -- View this message in context: http://www.nabble.com/-program_options---msvc-2010--1.34.1%3A-Error-when-com... Sent from the Boost - Users mailing list archive at Nabble.com.

(3) is a bug in VC10 - see https://connect.microsoft.com/VisualStudio/feedback/ ViewFeedback.aspx?FeedbackID=457199
Thanks Richard, I looked at your report again and saw a suggested change to map header there and applied it to my VC10 installation (I version the headers in git to be safe) and now I have a program_options dll! Cheers, Boris
participants (3)
-
Boris Dušek
-
Richard Webb
-
Vladimir Prus