[Click] Link error using Vector

Frederic Van Quickenborne frederic.vanquickenborne at intec.ugent.be
Tue Apr 13 16:30:34 EDT 2004


Hi,

didn't you forget to add this line in the .cc file:

#if EXPLICIT_TEMPLATE_INSTANCES
template class Vector<IPAddress>;
#endif

Regards,
Frederic.

At 17:44 9/04/2004 -0400, Peter De Cleyn wrote:

>Hi,
>
>I'm trying to use Vector to create some lists of custom build classes but
>I always encountered linking problems.
>
>I then wrote some basic tests to try it with the with click supplied
>classes and observed the following:
>
>void TestClass::test(Vector<String> &t){
>}
>
>void TestClass::test(Vector<IPAddress> &t){
>}
>
>void TestClass::test(Vector<String> &t){
>
>         Vector<String> a;
>}
>
>compiled and linked as should be, but
>
>
>void TestClass::test(Vector<String> &t){
>
>         Vector<IPAddress> a;
>}
>
>resulted in
>
>testclass.o(.text+0x5a0): In function 
>`TestClass::test(Vector<String>&)':../include/click/vector.hh:19: 
>undefined reference to `Vector<IPAddress>::~Vector [in-charge]()'
>collect2: ld returned 1 exit status
>make[1]: *** [click] Error 1
>make[1]: Leaving directory `/home/devel/click/click/userlevel'
>make: *** [install] Error 1
>
>
>
>Likewise, using Vector<String> _s; as an instance variable in TestClass
>works fine, using
>
>Vector<IPAddress> _s; results again in following errors
>
>testclass.o(.text+0x119): In function `TestClass::~TestClass
>[not-in-charge]()':../elements/local/testclass.cc:37: undefined reference
>to `Vector<IPAddress>::~Vector [in-charge]()'
>testclass.o(.text+0x1a9): In function `TestClass::~TestClass
>[in-charge]()':../elements/local/testclass.cc:37: undefined reference to
>`Vector<IPAddress>::~Vector [in-charge]()'
>testclass.o(.text+0x239):../elements/local/testclass.cc:37: more undefined
>references to `Vector<IPAddress>::~Vector [in-charge]()' follow
>collect2: ld returned 1 exit status
>make[1]: *** [click] Error 1
>make[1]: Leaving directory `/home/devel/click/click/userlevel'
>make: *** [install] Error 1
>
>
>The same happens when I try to use some own structs or class in Vector.
>
>
>can anyone please help me with this?
>
>have a nice weekend!
>
>Peter
>  ______________
>/Peter De Cleyn\
>-------------------------------------
>University of Antwerp
>Dep. Math. and Computer Science
>PATS research group
>-------------------------------------
>Middelheimlaan 1
>Building G
>B-2020 Antwerp
>-------------------------------------
>http://www.ua.ac.be
>http://win-www.ruca.ua.ac.be
>peter.decleyn at ua.ac.be
>+32 3 218 03 64
>
>_______________________________________________
>click mailing list
>click at amsterdam.lcs.mit.edu
>https://amsterdam.lcs.mit.edu/mailman/listinfo/click

==================================================================
Frederic Van Quickenborne
Department of Information Technology (INTEC)
Ghent University - IMEC
Sint-Pietersnieuwstraat 41, B-9000 Gent, Belgium
tel.: +32 (0)9-264 9957; tel. secr.: +32 (0)9-264 9970
fax: +32 (0)9-264 9960
Frederic.VanQuickenborne at intec.ugent.be
http://www.ibcn.intec.ugent.be



More information about the click mailing list