Hi List, hi C++Experts!
I have a problem with C++-Templates. I currently try to implement all the C++ STL-Containers and decided to make it with templates, because a lot of them have the same methods. The attached program is only the map (I know it's the same as pool, but there will follow the other containers...).
The problem: Everything compiles fine, but in PD: /win/Georg/PD-Externals/PDContainer/h_map.pd_linux: /win/Georg/PD-Externals/PDContainer/h_map.pd_linux: undefined symbol: _ZN12TPDContainerISt3mapI7Element5_atom7CompareSaISt4pairIKS1_S2_EEESt17_Rb_tree_iteratorIS6_RS6_PS6_EE8clearAllEv h_map ... couldn't create
a c++filt gives me the method: c++filt _ZN12TPDContainerISt3mapI7Element5_atom7CompareSaISt4pairIKS1_S2_EEESt17_Rb_tree_iteratorIS6_RS6_PS6_EE8clearAllEv 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>*> >::clearAll()
This method is in the Base Class TPDContainer and the map (class HMap) should have access to this method! If I override this method directly in class HMap the undifined symbol is in the method from the Base class TPDContainer.
Maybe it is a real trivial problem and some C++Expert could point me to it (or maybe the makefile should be modified ?)
Thanks for any help,
LG Georg
Hi Georg, are you sure the gcc compiler can handle template code to be compiled in separate object files? I would try to include the TPDContainer.cpp into TPDContainer.h, just as for NT defined. (line 122)
best greetings, Thomas
----- Original Message ----- From: "Georg Holzmann" grhPD@gmx.at To: pd-dev@iem.at Sent: Tuesday, October 12, 2004 4:29 PM Subject: [PD-dev] C++ templates - question
Hi List, hi C++Experts!
I have a problem with C++-Templates. I currently try to implement all the C++ STL-Containers and decided to
make
it with templates, because a lot of them have the same methods. The attached program is only the map (I know it's the same as pool, but there will follow the other containers...).
The problem: Everything compiles fine, but in PD: /win/Georg/PD-Externals/PDContainer/h_map.pd_linux: /win/Georg/PD-Externals/PDContainer/h_map.pd_linux: undefined symbol:
_ZN12TPDContainerISt3mapI7Element5_atom7CompareSaISt4pairIKS1_S2_EEESt17_Rb_ tree_iteratorIS6_RS6_PS6_EE8clearAllEv
h_map ... couldn't create
a c++filt gives me the method: c++filt
_ZN12TPDContainerISt3mapI7Element5_atom7CompareSaISt4pairIKS1_S2_EEESt17_Rb_ tree_iteratorIS6_RS6_PS6_EE8clearAllEv
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>*> >::clearAll()
This method is in the Base Class TPDContainer and the map (class HMap) should have access to this method! If I override this method directly in class HMap the undifined symbol is
in
the method from the Base class TPDContainer.
Maybe it is a real trivial problem and some C++Expert could point me to it (or maybe the makefile should be modified ?)
Thanks for any help,
LG Georg
-- +++ GMX DSL Premiumtarife 3 Monate gratis* + WLAN-Router 0,- EUR* +++ Clevere DSL-Nutzer wechseln jetzt zu GMX: http://www.gmx.net/de/go/dsl