Score:1

How to compile cap-ng on Impish?

sa flag

I'm on Impish, and have installed the latest version of libcap-ng-dev, Compiling with gcc 11.2, via Visual Studio Remote Linux

The following program cannot be statically linked

#include <cap-ng.h>

int main()
{
    capng_have_capability(0, 0);
}

Here is the build output:

1>/usr/bin/ld : error : really/long/path/main.o: in function `main':
1>main.c : error : (.text.startup+0xd): undefined reference to `capng_have_capability'
1>collect2 : error : ld returned 1 exit status

Here are the linker flags:

-o"really/long/path/out" "3600000" -Wl,-z,relro -Wl,-z,noexecstack -Wl,--no-undefined "g++ -static" -l"cap" -l"audit" -Wl,-L"/usr/lib/x86_64-linux-gnu" -Wl,-z,now 

Adding -lcap does not change the output.

Score:1
sa flag

Found the issue, I just needed to add -lcap-ng.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.