libwebsockets编译

#安装 libwebsocket

git clone https://github.com/warmcat/libwebsockets && \

mkdir libwebsockets/build && cd libwebsockets/build && \

cmake -DMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" .. && \

make && make install

make错误:

cpp 复制代码
In file included from /opt/projects/open/libwebsockets/lib/plat/unix/unix-sockets.c:31:
/usr/include/linux/ipv6.h:19:8: 错误:'struct in6_pktinfo'重定义
   19 | struct in6_pktinfo {
      |        ^~~~~~~~~~~
In file included from /opt/projects/open/libwebsockets/lib/plat/unix/./private-lib-plat-unix.h:31,
                 from /opt/projects/open/libwebsockets/lib/core/./private-lib-core.h:138,
                 from /opt/projects/open/libwebsockets/lib/plat/unix/unix-sockets.c:28:
/usr/include/netinet/in.h:538:8: 附注:原先在这里定义
  538 | struct in6_pktinfo
      |        ^~~~~~~~~~~
In file included from /opt/projects/open/libwebsockets/lib/plat/unix/unix-sockets.c:31:
/usr/include/linux/ipv6.h:24:8: 错误:'struct ip6_mtuinfo'重定义
   24 | struct ip6_mtuinfo {
      |        ^~~~~~~~~~~
In file included from /opt/projects/open/libwebsockets/lib/plat/unix/./private-lib-plat-unix.h:31,
                 from /opt/projects/open/libwebsockets/lib/core/./private-lib-core.h:138,
                 from /opt/projects/open/libwebsockets/lib/plat/unix/unix-sockets.c:28:
/usr/include/netinet/in.h:545:8: 附注:原先在这里定义
  545 | struct ip6_mtuinfo

修改

cpp 复制代码
vi /opt/projects/open/libwebsockets/lib/plat/unix/unix-sockets.c
注释掉//#include <linux/ipv6.h>

cmake要修改为

cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_FLAGS="-fPIC -Wno-error=sign-conversion -Wno-error" -DLWS_WITH_WERROR=OFF

相关推荐
光电的一只菜鸡5 小时前
ubuntu之坑(二十)——VMware虚拟机系统无法正常进入如何处理
linux·运维·ubuntu
你住过的屋檐6 小时前
【Nginx】linux上安装nginx
linux·运维·nginx
宵时待雨7 小时前
linux笔记归纳17:传输层协议UDP
linux·笔记·udp
SCandL1528 小时前
k8s service
linux·容器·kubernetes
会飞的土拨鼠呀9 小时前
Linux的存储使用率应该如何计算
linux·运维·服务器
weixin_5112552111 小时前
NGINX常用配置
linux·服务器·nginx
昌原的儿子LEO11 小时前
进程和线程(2)
linux·服务器·网络
会飞的土拨鼠呀12 小时前
Linux 真实内存使用率的核心计算标准
linux·运维·服务器
陈年老古董13 小时前
CentOS编译安装Python3.11完整教程
linux·笔记·学习·centos·python3.11
深念Y13 小时前
为什么选 Go:直观、可维护、AI 友好
linux·开发语言·人工智能·golang·agent·harness