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

相关推荐
乌萨奇也要立志学C++2 小时前
【Linux】网络基础 从零理解网络通信:局域网、跨网传输与 Socket 预备知识
linux·服务器·网络
RisunJan4 小时前
Linux命令-slabtop(实时显示内核 slab 缓存信息)
linux
蚰蜒螟6 小时前
从内核源码看Linux启动:chroot、execve与MS_MOVE的协奏曲
linux·服务器·网络
酷可达拉斯6 小时前
自动化运维-ansible配置文件与主机清单
linux·运维·自动化·ansible
影视飓风TIM7 小时前
Linux下C语言缓冲区原理 + Git版本控制
linux·c语言·git
来者皆善7 小时前
ZYNQ linux上使用 USB CDC ACM
linux·运维·服务器
☆凡尘清心☆8 小时前
CentOS Stream 9 专用 LNMP 全自动一键脚本
linux·运维·mysql·nginx·lnmp·centos stream 9
Dawn-bit8 小时前
Linux磁盘分区与Swap和磁盘故障查询
linux·运维·服务器·网络·云计算
无足鸟ICT10 小时前
【RHCA+】$[]
linux·运维·服务器
运维技术小记10 小时前
国产化环境配置 VNC 远程桌面:麒麟 V10 实战
linux·运维·服务器