Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with adding library #489

Open
ali64mohammad opened this issue May 12, 2021 · 3 comments
Open

issue with adding library #489

ali64mohammad opened this issue May 12, 2021 · 3 comments

Comments

@ali64mohammad
Copy link

Hi.
i wrote a library in click and i place .cc in click/lib and .hh file in click/include and also add .o file in MakeFile.in in userlevel, linuxevel, ns, minios,tools/lib folders and in DSTFILES.
When I use this library in elements in click, everything is fine.
I also wrote an Element from the sample Package in click/etc/samplepackage and it's working without any error.
But when I add Library that I wrote, in this element, I saw undefined symbol error which means the library not included properly. but library works in click elements. and libraries like glue works in package element.
any idea what's wrong?
thanks.

@tbarbette
Copy link
Collaborator

What do you mean by everything is fine when you use the library in elements? Click fully compiles? In which case do you get the undefined symbol then?

@tbarbette
Copy link
Collaborator

You can use make V=1 to verify the library is indeed linked in libclick.a

@ali64mohammad
Copy link
Author

ali64mohammad commented May 12, 2021

if I use my library in for example classifier element that is in the click project, I can call my library function and it works.
and click fully compiles without error.
But if I use my library in my element that is a package and I wrote it, both click and element will be compiled, but when I run a .click file with my element, the error shows up.
and if I remove my library from my element, it runs and does its job without any error.
I check libclick.a file and .o file of my library exists in it.
and header files exists in /usr/local/click/include

where should I use make V=1 in element or in click?
my general question is how to add a library to click like glue library. that every element can include it ,like this:

include <click/test_library>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants