-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Get error "Undefined reference to cap_xxx
" when link libwebsockets built from master.
#1975
Comments
It should look and see if you have libcap headers, and add it automatically: https://libwebsockets.org/git/libwebsockets/tree/CMakeLists.txt#n559 Is your pkgconf for libcap installed somewhere unusual? |
Ah... It's possible it my fault, and I just don't have libcap-dev installed... Sorry, closing. |
But on other side, why it sill uses |
It should use them if it finds the header during cmake |
Yes, it's something weird there... But please don't care - I'll try to find reason myself. |
Let me know if something to fix :-) |
It's something really strange. I've installed
i.e. there are no libcap reference there. |
I can investigate it myself, but maybe you will find issue much quicker... |
OK I will do the same test tomorrow and see what happens. |
Some more info, I get |
I think I found the reason: https://github.com/warmcat/libwebsockets/blob/master/lib/CMakeLists.txt#L273 |
Thanks for digging into it... IIUI it just needs this?
|
It's not only about |
Some new find: according to pkg-config docs there are better way add dependencies from extern libraries - use |
Some more experimenting. It works fine if I edit
|
I fiddled with it a bit but I was not smart enough to understand how to autogenerate the pkgconfig format from what cmake has. I settled from having that maintained separately for optional packages... https://libwebsockets.org/git/libwebsockets/commit?id=c8baeccfd76d324c1454cb9b57bf01a95ad5b500 is this enough or more libs need to be taken care about? |
@lws-team yes, it looks like it will work. The only question if libcap v2.0 is really minimal required version. I just never worked with libcap, so don't sure. |
Well, version in Fedora 32 is 1.9... upstream is 2.38 I don't think it uses anything so new, I changed it to not specify a version relationship. That's legal https://dev.gentoo.org/~mgorny/pkg-config-spec.html#package-list I'll close it for now then. |
Don't sure, but maybe it worth consider add libcap as dependency to
libwebsockets.pc
?The text was updated successfully, but these errors were encountered: