Skip to main content

首页

Levelip

level ip

头文件找不到

Fatal error: sys/capability.h: No such file or directory

解决办法

$ sudo apt-get install libcap-dev

(参考)[https://blog.csdn.net/buyicn/article/details/80635762]

其它的修改:

$ git diff
diff --git a/Makefile b/Makefile
index ae9882e..537969c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CPPFLAGS = -I include -Wall -Werror -pthread
+CPPFLAGS = -I include -Wall -Werror -pthread  -std=gnu99 -lpthread

 src = $(wildcard src/*.c)
 obj = $(patsubst src/%.c, build/%.o, $(src))
diff --git a/include/socket.h b/include/socket.h
index f9db44f..026e099 100644
--- a/include/socket.h
+++ b/include/socket.h
@@ -1,6 +1,8 @@
 #ifndef SOCKET_H_
 #define SOCKET_H_

+#include <pthread.h>
+
 #include "sock.h"
 #include "wait.h"
 #include "list.h"
diff --git a/src/cli.c b/src/cli.c
index 3574b6c..2fd36ba 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -1,3 +1,5 @@
+#define _POSIX_C_SOURCE 2
+
 #include "syshead.h"
 #include "utils.h"
 #include "cli.h"