warmcat / libwebsockets

canonical libwebsockets.org networking library
https://libwebsockets.org
Other
4.73k stars 1.48k forks source link

what's the problem with the tips "unix-caps.c:(.text+0x1d): undefined reference to `cap_get_proc'" #3210

Open qingzhou-2 opened 3 weeks ago

qingzhou-2 commented 3 weeks ago

Here is the error report:

[ 20%] Linking CXX executable build/simple_web_server /usr/bin/ld: /home/long/test9/webassembly-ffmpeg-main/server/libwebsockets/lib/libwebsockets.a(unix-caps.c.o): in function _lws_plat_apply_caps': unix-caps.c:(.text+0x1d): undefined reference tocap_get_proc' /usr/bin/ld: unix-caps.c:(.text+0x3d): undefined reference to cap_set_flag' /usr/bin/ld: unix-caps.c:(.text+0x49): undefined reference tocap_set_proc' /usr/bin/ld: unix-caps.c:(.text+0x79): undefined reference to `cap_free' collect2: error: ld returned 1 exit status

my OS is ubuntu 20.04.6-desktop-amd64 libwebsockets version is 4.3-stable (and I have tried version 4.2-stable, 4.0-stable, -main, it's have the same problem)

here is my build command:

mkdir build cd build/ cmake ../-DCMAKE_INSTALL_PREFIX=. -DCMAKE_SYSTEM_NAME=Linux make

did anybody have solved this problem ? thanks very much

lws-team commented 3 weeks ago

Do we have libcap and libcap-dev (or -devel or whatever) installed?