[Click] hashmap

Beyers Cronje bcronje at gmail.com
Mon Mar 14 08:31:27 EST 2005


Hi Bart,

Have a look at tcprewriter or iprewriter in
<clickdir>/elements/tcpudp/ on usage of bighashmap.
In your .cc file you also need to specify #include <click/bighashmap.cc>
for template purposes, see last lines of above elements' .cc files.

Hope this helps.

Beyers




On Mon, 14 Mar 2005 13:15:08 +0000, Bart Van Keyenberg
<bartvk8 at hotmail.com> wrote:
> Hi,
> 
> Like Alan I am trying to use the hashmap from click.
> As key value I use an unsgined (hash of ipaddress). As value for each key I
> use a self written class called Userinfo. When I compile this, the compiler
> gives some errors about undefined references.
> Here's a piece of the code
> 
> //-*-c-basic-offset: 4 -*-
> #ifndef CLICK_DUMMY_HH
> #define CLICK_DUMMY_HH
> #include <click/hashmap.hh>
> #include "userinfo.hh"
> CLICK_DECLS
> class Dummy { public:
> 
>     Dummy();
>     ~Dummy();
>     void dosomething();
> 
>     private:
> 
>     HashMap<unsigned, Userinfo> _map;
> 
> };
> 
> CLICK_ENDDECLS
> #endif
> 
> The errors @ compile time are the following
> 
> dummy.o(.text+0x1b): In function `Dummy::~Dummy [in-charge]()':
> ../elements/local/dummy.cc:7: undefined reference to `HashMap<unsigned,
> Userinfo>::~HashMap [in-charge]()'
> dummy.o(.text+0x3b): In function `Dummy::~Dummy [not-in-charge]()':
> ../elements/local/dummy.cc:7: undefined reference to `HashMap<unsigned,
> Userinfo>::~HashMap [in-charge]()'
> dummy.o(.text+0x55): In function `Dummy::Dummy[in-charge]()':
> ../elements/local/dummy.cc:6: undefined reference to `HashMap<unsigned,
> Userinfo>::HashMap[in-charge]()'
> dummy.o(.text+0x65): In function `Dummy::Dummy[not-in-charge]()':
> ../elements/local/dummy.cc:6: undefined reference to `HashMap<unsigned,
> Userinfo>::HashMap[in-charge]()'
> collect2: ld returned 1 exit status
> make: *** [click] Fout 1
> 
> Kind Regards
> 
> <html><P><FONT size=5><EM><A href="mailto:bartvk8 at hotmail.com">Bart
> V.K.</A></EM></FONT></P></html>
> 
> _________________________________________________________________
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list