compile problem/gcc problem in kxmlcore: HashMap.h

Alexander Neundorf neundorf at kde.org
Fri Jan 20 20:20:46 GMT 2006


Hi,

I'm using gcc 3.2.3 and when trying to compile kdelibs/kjs/internal.cpp I get 
the following error:

/usr/bin/c++  -Dkjs_EXPORTS  -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef 
-Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith 
-Wwrite-strings -O2 -Wformat-security -Wmissing-format-attribute 
-fno-exceptions -fno-check-new -fno-common -fPIC 
<...skipped include dirs...> 
-DQT3_SUPPORT -DQT_CLEAN_NAMESPACE -D_XOPEN_SOURCE=500 -D_BSD_SOURCE 
-D_GNU_SOURCE -DHAVE_CONFIG_H=1 -o kjs/CMakeFiles/kjs.dir/internal.o 
-c /home/alex/src/kde4-svn/kdelibs/kjs/internal.cpp
/home/alex/src/kde4-svn/kdelibs/kjs/internal.cpp:50:5: warning: "WIN32" is not 
defined
/home/alex/src/kde4-svn/kdelibs/kjs/internal.cpp:59:6: warning: 
"APPLE_CHANGES" is not defined
/home/alex/src/kde4-svn/kdelibs/kjs/internal.cpp:681:5: warning: 
"APPLE_CHANGES" is not defined
In file included from /home/alex/src/kde4-svn/kdelibs/kjs/internal.cpp:153:
/home/alex/src/kde4-svn/kdelibs/kxmlcore/HashMap.h: In instantiation of 
`KXMLCore::HashTable<Key, std::pair<_T1, _T2>, extractFirst<std::pair<_T1, 
_T2> >, HashFunctions, KXMLCore::PairHashTraits<KeyTraits, MappedTraits> 
>::const_iterator KXMLCore::HashMap<Key, Mapped, HashFunctions, KeyTraits, 
MappedTraits>::end() const [with Key = void*, Mapped = void*, HashFunctions = 
KXMLCore::DefaultHash<void*>, KeyTraits = KXMLCore::HashTraits<void*>, 
MappedTraits = KXMLCore::HashTraits<void*>]':
/home/alex/src/kde4-svn/kdelibs/kxmlcore/HashTable.h:159:   instantiated from 
`bool KXMLCore::HashTableConstIterator<Key, Value, ExtractKey, HashFunctions, 
Traits>::operator==(const KXMLCore::HashTableConstIterator<Key, Value, 
ExtractKey, HashFunctions, Traits>&) const [with Key = void*, Value = 
std::pair<void*, void*>, Key (*ExtractKey)(const Value&) = 
KXMLCore::extractFirst(const PairType&) [with PairType = std::pair<void*, 
void*>], HashFunctions = KXMLCore::DefaultHash<void*>, Traits = 
KXMLCore::PairHashTraits<KXMLCore::HashTraits<void*>, 
KXMLCore::HashTraits<void*> >]'
/home/alex/src/kde4-svn/kdelibs/kjs/internal.cpp:153:   instantiated from 
`Mapped KXMLCore::HashMap<Key, Mapped, HashFunctions, KeyTraits, 
MappedTraits>::get(const Key&) const [with Key = void*, Mapped = void*, 
HashFunctions = KXMLCore::DefaultHash<void*>, KeyTraits = 
KXMLCore::HashTraits<void*>, MappedTraits = KXMLCore::HashTraits<void*>]'
/home/alex/src/kde4-svn/kdelibs/kjs/internal.cpp:200:   instantiated from `Q* 
KXMLCore::HashMap<P*, Q*, KXMLCore::PointerHash<P*>, 
KXMLCore::HashTraits<P*>, KXMLCore::HashTraits<Q*> >::get(P* const&) const 
[with P = KJS::ObjectImp, Q = KJS::InterpreterImp]'
/home/alex/src/kde4-svn/kdelibs/kjs/internal.cpp:827:   instantiated from here
/home/alex/src/kde4-svn/kdelibs/kxmlcore/HashMap.h:116: `extractFirst' was not
   declared in this scope
/home/alex/src/kde4-svn/kdelibs/kxmlcore/HashMap.h:116: could not convert
   template argument `<declaration error><std::pair<void*, void*> >' to `
   void*(*)(const std::pair<void*, void*>&)'
/home/alex/src/kde4-svn/kdelibs/kxmlcore/HashMap.h:116: `extractFirst' was not
   declared in this scope
/home/alex/src/kde4-svn/kdelibs/kxmlcore/HashMap.h:116: could not convert
   template argument `<declaration error><std::pair<void*, void*> >' to `
   void*(*)(const std::pair<void*, void*>&)'
/home/alex/src/kde4-svn/kdelibs/kxmlcore/HashMap.h:116: confused by earlier 
errors, bailing out
make[3]: *** [kjs/CMakeFiles/kjs.dir/internal.o] Error 1

The code in kxmlcore/HashMap.h is far beyond my template knowledge.
I guess gcc 3.2.3 simply isn't able to handle it, although it is probably 
correct C++.

What can we do about it ? I don't even have an idea how to simplify it, 
therefor I would at least have to understand it...
The code works with gcc 3.4, don't know about gcc 3.3. Apple uses gcc >= 4.0. 

Any suggestions ?

Bye
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net




More information about the kfm-devel mailing list