[Click] Using class templates compile, but fail to link at runtime.

Paine, Thomas Asa PAINETA at uwec.edu
Thu Oct 5 13:21:19 EDT 2006


Eddie,
	I resolved the symbol problem regarding vmalloc usage by
using...  (from icmpsendpings.cc), which I guess corrects some linkages.
I have not went back to try templates again, yet.

# include <click/cxxprotect.h>
CLICK_CXX_PROTECT
# include <linux/vmalloc.h>
CLICK_CXX_UNPROTECT

Thanks, 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
   Thomas Paine (paineta at uwec.edu) 
   University of Wisconsin - Eau Claire 
   garbage foo(garbage g){return(g);} 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

-----Original Message-----
From: click-bounces at pdos.csail.mit.edu
[mailto:click-bounces at pdos.csail.mit.edu] On Behalf Of Paine, Thomas Asa
Sent: Tuesday, October 03, 2006 5:11 PM
To: Eddie Kohler
Cc: click at pdos.csail.mit.edu
Subject: Re: [Click] Using class templates compile,but fail to link at
runtime.

Eddie,
	I haven't tried the template version again yet, but the non
template class is now doing it after replacing its news/deletes with
vmalloc/vfree (because of large array allocations in this class).  This
too produced similar errors when trying to install the module (below).
Removing the ksyms.* didn't seem to make any difference here.

With using vmalloc....

click: starting router thread pid 1050 (f7950640)
tms: module license 'unspecified' taints kernel.
tms: Unknown symbol _Z5vfreePv
tms: Unknown symbol _Z7vmallocm

Thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
   Thomas Paine (paineta at uwec.edu) 
   University of Wisconsin - Eau Claire 
   garbage foo(garbage g){return(g);}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
 


-----Original Message-----
From: Eddie Kohler [mailto:kohler at cs.ucla.edu]
Sent: Sunday, October 01, 2006 6:51 PM
To: Paine, Thomas Asa
Cc: click at amsterdam.lcs.mit.edu
Subject: Re: [Click] Using class templates compile, but fail to link at
runtime.

Hi Thomas,

Try the following magic incantation:

    cd CLICKBUILDDIR
    rm linuxmodule/ksyms.*
    make install

and then click-install again.  I think there may be an issue with the
way the new Click build process marks symbols as exportable.

Eddie


Paine, Thomas Asa wrote:
> 	I have added a simple template based class to my own package,
but for 
> some reason it will not link when click-install is run.  When I build 
> the package I have no compilation errors and everything seems to look 
> good.  The class uses the ELEMENT_PROVIDES(HistoryQueue) and the user 
> element uses ELEMENT_REQUIRES(HistoryQueue).  Checking the 
> kelements.conf and elementmap-tms.xml files I can see everything is 
> accounted for.  As well, all the .ko files are produced.  If I 
> implement my class without using templates it compiles, links, and 
> loads fine (and runs).
> 
> However, when I try to load my TMS package with the template version 
> of the implementation I get this...
> 
> click: starting router thread pid 28918 (f6699de0)
> tms: Unknown symbol _ZN12HistoryQueueI5EventE3popEv
> tms: Unknown symbol _ZN12HistoryQueueI5EventED1Ev
> tms: Unknown symbol _ZN12HistoryQueueI5EventEC1Ej
> tms: Unknown symbol _ZN12HistoryQueueI5EventE4pushERS0_
> click: stopping router thread pid 28918
> 
> 
> Is there something special like a pecompiler setting, something I need

> to declare, macro, or something in the packages Makefile I need to 
> add/change when using templates in my classes?  When looking at things

> like bighashmap or vector (which also use templates), I don't see any 
> major differences (except for what seems to be misplaced 
> CLICK_ENDDECLS and CLICK_DECLS macros in those).
> 
> Thanks,
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
>    Thomas Paine (paineta at uwec.edu) 
>    University of Wisconsin - Eau Claire 
>    garbage foo(garbage g){return(g);} 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click

_______________________________________________
click mailing list
click at amsterdam.lcs.mit.edu
https://amsterdam.lcs.mit.edu/mailman/listinfo/click



More information about the click mailing list