[Click] element_provides and element_requires

Bart Braem bart.braem at ua.ac.be
Fri Jul 6 04:51:52 EDT 2007


Nele,

On Friday 06 July 2007 09:55, Nele Gheysens wrote:
> Eddie, you asked my which linker errors appeared. But I cannot reproduce
> these linker errors anymore after performing a make distclean. 

(This is always a good thing to do when you have strange errors, even better 
Makefiles like the ones used in Click can't avoid linking leftovers.)

> End of file trains_CDM.cc:
>
> CLICK_ENDDECLS
> ELEMENT_REQUIRES(sctp_Trains_TCB)
> ELEMENT_REQUIRES(sctp_Trains_Timer )
> ELEMENT_REQUIRES(sctp_Trains_Link)
> EXPORT_ELEMENT(Trains_CDM)
>
> When I compile this, I get the following error:
>
> ../elements/local/trains/trains_CDM.cc:98: error:
> `get_databuffer_length' undeclared (first use this function)
> (and so on for some other functions)
>  
>
> where get_databuffer_length()  (and the other functions the compiler is
> complaining about) is a funcion provided bij trains_tcb.cc.
> If I put a mistake in de file trains_tcb.cc or trains_tcb.hh, the
> compiler doesn't complain. So I believe that this file isn't compiled.
> But I don't understand why.

Did you include trains_tcb.hh in trains_CDM.cc? I think ELEMENT_REQUIRES does 
not do any source file includes, so you must make the functions visible 
yourself by including the right headers.
(Perhaps you did this, but then I completely don't understand why the compiler 
does not complain about mistakes in those files.)

Bart
-- 
Bart Braem
PATS research group
Dept. of Mathematics and Computer Sciences
University of Antwerp
Campus Middelheim, G3.30
Middelheimlaan 1
B-2020 Antwerpen, Belgium
Phone: +32 (0)3 265.32.91
Fax: +32 (0)3 265.37.77
Web: www.pats.ua.ac.be/bart.braem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: not available
Url : https://pdos.csail.mit.edu/pipermail/click/attachments/20070706/8c60c65e/attachment.pgp


More information about the click mailing list