[webkit-dev] Strange Compile Error in HashMap/HashSet

Krzysztof Kowalczyk kkowalczyk at gmail.com
Sun Oct 2 01:27:35 PDT 2005


I don't have an answer just 2 observations:

1. VC 2005 (8.0) handles this a little better i.e. it can compile but
fails at link time:

internal.obj : error LNK2019: unresolved external symbol "void *
__cdecl KXMLCore::extractFirst<struct std::pair<void *,void *>
>(struct std
::pair<void *,void *> const &)"
(??$extractFirst at U?$pair at PAXPAX@std@@@KXMLCore@@YAPAXABU?$pair at PAXPAX@std@@@Z)
referenced in function "priva
te: static void * __cdecl KXMLCore::HashTable<void *,struct
std::pair<void *,void *>,&void * __cdecl KXMLCore::extractFirst<struct
std::pair
<void *,void *> >(struct std::pair<void *,void *> const &),struct
KXMLCore::DefaultHash<void *>,struct KXMLCore::PairHashTraits<struct
KXMLC
ore::HashTraits<void *>,struct KXMLCore::HashTraits<void *> >
>::extractKey(struct std::pair<void *,void *> const &)"
(?extractKey@?$HashTab
le at PAXU?$pair at PAXPAX@std@@$1??$extractFirst at U?$pair at PAXPAX@std@@@KXMLCore@@YAPAXABU12@@ZU?$DefaultHash at PAX@3 at U?$PairHashTraits at U?$HashTraits
@PAX at KXMLCore@@U12@@3@@KXMLCore@@CAPAXABU?$pair at PAXPAX@std@@@Z)
bin\testkjs.exe : fatal error LNK1120: 1 unresolved externals

2.
#include <bits/cpp_type_traits.h>
in kxmlcore\HashTraits.h is questionable. According to the source
(http://www-evasion.imag.fr/Membres/Frank.Perbet/extdox/stl/html/cpp__type__traits_8h-source.html)
it's a private header for libstdc++ and should not be directly
included by applications.

-- kjk

On 9/29/05, Justin Haygood <justin at xiondigital.net> wrote:
> Apparently, Microsoft Visual C++ 7.1 doesn't like HashMap:
>
> {snip}\JavaScriptCore\kxmlcore\HashMap.h(46) : error C2440: 'specialization' :
> cannot convert from 'T1::first_type (__cdecl *)(const T1 &)' to
> 'KXMLCore::HashMap<Key,Mapped,HashFunctions,KeyTraits,MappedTraits>::KeyType
> (__cdecl *)(const
> KXMLCore::HashMap<Key,Mapped,HashFunctions,KeyTraits,MappedTraits>::ValueType &)'
>         None of the functions with this name in scope match the target type
>
> This error is fired in 2 cases: different calling conventions (not the case here,
> both using cdecl) or something I don't particularly understand (something along
> the lines like casting from a TemplateType<Bla> to a TemplateType).
>
> Any clues as to what its not liking?
>
> Relevant code:
>
>  private:
>     typedef HashTable<KeyType, ValueType, extractFirst<ValueType>, HashFunctions,
> ValueTraits> ImplType;
>
> I highly believe its the extractFirst<ValueType> that's causing the failure,
> which is defined as:
>
> template<typename PairType>
> inline typename PairType::first_type extractFirst(const PairType& value)
> {
>     return value.first;
> }
>
> Thanks,
> Justin Haygood
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at opendarwin.org
> http://www.opendarwin.org/mailman/listinfo/webkit-dev
>



More information about the webkit-dev mailing list