[PD-dev] C++ templates - question

Georg Holzmann grhPD at gmx.at
Wed Oct 13 14:38:20 CEST 2004


Hallo!

Okay, I think the code-organisation problem is solved now.

Now it compiles, but I have an other Problem:
I use a static map in HMap.h (which is declared in TPDContainerBase.h) and
normally I have to define the map in HMap.h like:
// define the static member:
map<Element,atom,Compare> HMap::data_;

But then I get the compiler error:
src/HMap.cpp:18: error: ISO C++ does not permit
`TPDContainer<std::map<Element,
   atom, Compare, std::allocator<std::pair<const Element, atom> > >,
   std::_Rb_tree_iterator<std::pair<const Element, atom>, std::pair<const
   Element, atom>&, std::pair<const Element, atom>*> >::data_' to be defined
as
   `HMap::data_'

And if I don't define it, it compiles but I get an undefined symbol in PD:
c++filt
_ZN12TPDContainerISt3mapI7Element5_atom7CompareSaISt4pairIKS1_S2_EEESt17_Rb_tree_iteratorIS6_RS6_PS6_EE5data_E
TPDContainer<std::map<Element, _atom, Compare,
std::allocator<std::pair<Elementconst, _atom> > >,
std::_Rb_tree_iterator<std::pair<Element const, _atom>, std::pair<Element
const, _atom>&, std::pair<Element const, _atom>*> >::data_
holzi at holzi:~$ c++filt
_ZN12TPDContainerISt3mapI7Element5_atom7CompareSaISt4pairIKS1_S2_EEESt17_Rb_tree_iteratorIS6_RS6_PS6_EE5data_E
TPDContainer<std::map<Element, _atom, Compare,
std::allocator<std::pair<Elementconst, _atom> > >,
std::_Rb_tree_iterator<std::pair<Element const, _atom>, std::pair<Element
const, _atom>&, std::pair<Element const, _atom>*> >::data_

Has anyone an idea ??
Thanks a lot!

LG
Georg

-- 
GMX ProMail mit bestem Virenschutz http://www.gmx.net/de/go/mail
+++ Empfehlung der Redaktion +++ Internet Professionell 10/04 +++





More information about the Pd-dev mailing list