[C++-sig] Re: boost::python::range and duplicate comdat under MSVC 6

Raoul Gough RaoulGough at yahoo.co.uk
Fri Oct 31 20:19:16 CET 2003


Nikolay Mladenov <nickm at sitius.com> writes:

> Raoul Gough wrote:
>> iterator.obj : fatal error LNK1179: invalid or corrupt file:
>> duplicate comdat
>> "?registration@?$shared_ptr_from_python at U?$iterator_range at U?$return_
value_policy at Ureturn_by_value@python at boost@@$D"
>> 
> I have seen this couple of times.  I seems the MSVC cuts the names
> to a certain position and when you have many namespaces and
> templates you can end up with two names that are different after
> this cutting point.  I was solving it by rearranging the names.

Hmmm... The symbol that the linker complains about is only about 120
characters long (at least that's the symbol it is reporting). I'm sure
the compiler can successfully handle names much longer than that.

Since you mention it though, I've now tried changing the example to
use int * and double * as iterators instead of list iterators to
reduce the length of any mangled names. The linker problem persists,
and using "dumpbin /symbols", I can see some (working) identifiers
that include the full iterator_range type info, e.g.:

?converters@?$registered_base at AAU?$iterator_range at U?$return_value
_policy at Ureturn_by_value@python at boost@@Udefault_call_policies at 23@
@python at boost@@PAPAN at objects@python at boost@@@detail at converter@pyth
on at boost@@2ABUregistration at 345@B
(public: static struct boost::python::converter::registration con
st & const  boost::python::converter::detail::registered_base<str
uct boost::python::objects::iterator_range<struct boost::python::
return_value_policy<struct boost::python::return_by_value,struct 
boost::python::default_call_policies>,double * *> &>::converters)

However, the problematic symbol doesn't demangle (or "undecorate")
properly:

?registration@?$shared_ptr_from_python at U?$iterator_range at U?$retur
n_value_policy at Ureturn_by_value@python at boost@@$E
( ??  ?? :: ?? ::registration)

Weird. I'd be interested to know where the symbol comes from - there
might be some way to force the two instaces of it to get different
names.

-- 
Raoul Gough.
(setq dabbrev-case-fold-search nil)





More information about the Cplusplus-sig mailing list