Closed ali64mohammad closed 3 years ago
You just have to add ELEMENT_PROVIDES(dep_name) in dep.cc as if it was an "element" .cc file, even if it's not a real element. Look at elements/userlevel/netmapinfo.cc .
Then in test.cpp add "ELEMENT_REQUIRES(dep_name)" and it will refuse to load if dep.cc is not loaded first. I don't know any auto-load, but you can just add the requires in order.
An fast and easy way is to include dep.cc in test.cpp if multiple elements do not need "dep.cc" though...
Thanks it works.
Hi, i wrote a Click Element and it includes these files: test.cpp // main element file test.hh dep.cc // dependency file dep.hh
in test.hh, I included dep. hh and in test.cpp I use dep.cc functions that defined in dep.hh. (ex. dep_function) There is no error in build, but When I run click this error shows up.
my Element is in a package and not in click elements. should i add something to makeFile.in or configure.ac? is dep.cc compiled?