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

相关推荐
Kira Skyler21 小时前
抓虫:sw架构防火墙服务启动失败 Unable to initialize Netlink socket: 不支持的协议
java·linux
一张假钞21 小时前
Windows 11主机Ubuntu 24.04虚机共享目录权限问题
linux·运维·ubuntu
GoodG_study21 小时前
一文教您解决win11运行Ubuntu,wsl相关命令出现系统找不到指定文件的错误提示
linux·ubuntu·wsl
理智的煎蛋1 天前
MySQL高可用架构:MHA
linux·数据库·mysql·架构·可用性测试
zz-zjx1 天前
进程与线程详解, IPC通信与RPC通信对比,Linux前台与后台作业
linux·网络协议·rpc
大筒木老辈子1 天前
Linux笔记---计算机网络概述
linux·笔记·计算机网络
keep__go1 天前
postgresql9.2.4 跨版本升级14.6
linux·运维·数据库·postgresql
深思慎考1 天前
LinuxC++项目开发日志——高并发内存池(1-定长内存池)
linux·c++
川石课堂软件测试1 天前
Oracle 数据库如何查询列
linux·数据库·sql·功能测试·oracle·grafana·prometheus
光电的一只菜鸡1 天前
ubuntu之坑(十九)——VMware虚拟机扩容磁盘
linux·数据库·ubuntu