[Click] Compile a non-element class in Click

Eddie Kohler kohler at cs.ucla.edu
Thu Sep 4 09:20:10 EDT 2008


It is ELEMENT_PROVIDES(), not ELEMENTS_PROVIDES().

The file should appear in elements.conf.

Your use of the .cpp extension is probably the problem.  Click's build tools 
require the .cc extension.

Eddie


Giovanni Di Stasi wrote:
> On Wednesday 03 September 2008 16:50:49 Bart Braem wrote:
>> On 03 Sep 2008, at 16:35, Giovanni Di Stasi wrote:
>>> I'm not having success in compiling a C++ class (that is not an
>>> element) in
>>> Click.
>>>
>>> I added CLICK_DECLS after the beginning of the cpp file, just after
>>> the
>>> include directives, and
>>>
>>> CLICK_ENDDECLS
>>> ELEMENTS_PROVIDES(Lq_quality)
>>>
>>> at the end of the same file.
>>>
>>> I try to compile issuing make elemlist and make, but that file is
>>> not getting
>>> compiled.
>>>
>>> Do you have any hints?
>> Please post your code and the error you get, it is impossible to debug
>> your problem without it.
>> Even a limited version of the code without functionality is alright.
>>
>> Regards,
>> Bart Braem
> 
> I realized a simple class that does not get compiled as well:
> 
> // testcompile.h
> #ifndef TESTCOMPILE
> #define TESTCOMPILE
> 
> #include <assert.h>
> 
> class TestCompile {
> 
> public:
> 
> 	TestCompile(){
> 		int i=0;
> 		i++;
> 		i=i-1;
> 		test();
> 	}
> 
> 	void test();
> 
> };
> 
> //testcompile.cpp
> #include "testcompile.h"
> 
> CLICK_DECLS
> 
> void TestCompile::test(){
> 	int j=0;
> 
> 	j++;
> 	j--;
> 
> }
> 
> CLICK_ENDDECLS
> ELEMENTS_PROVIDES(TestCompile)
> 
> Both files are placed in a the directory elements/local/fcra
> 
> Thanks for the support.
> 
> 
> 


More information about the click mailing list