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

相关推荐
HideF5 小时前
Linux
linux·服务器·网络
Ruiery7 小时前
Linux 6.6内核内存管理深度解析(十三):slab/slub 分配器
linux·运维·服务器
丰锋ff9 小时前
压缩命令笔记
linux
GeW11 小时前
产业新优势基础软件的人才底盘,从Linux与数据库开始
linux·数据库
by2099911 小时前
Linux GCC/G++ 编译与 Makefile 构建
linux·运维·服务器·经验分享
cq林志炫12 小时前
两个Linux服务器之间同步文件
linux·运维·服务器
无人生还别怕12 小时前
如何搭建k8s服务(containerd部署)
linux·云原生·容器·kubernetes·openanolisos
企鹅侠客13 小时前
Linux CPU 负载平均值(Load Average)详解:从原理到实践
linux·运维·服务器·服务器负载
易点云徐源13 小时前
HP 暗影精灵 PRO 16 安装双系统后,开机直接进入 Windows,按 F9 才能进入 Ubuntu:GRUB 菜单不显示的处理方法
linux·运维·ubuntu
第404号工位14 小时前
离职退电脑前别只点“清空回收站”!手把手教你彻底抹除凭证与数字痕迹
linux·python·架构