当前位置: 首页 > news >正文

Linux - 弯路系列3:安装和编译libvirt-4.5.0

系统:Anolis8(离线)

目录

  • 1、步骤
  • 2、make过程中的错误
    • 错误1:error: 'xdr_u_int64_t' undeclared (first use in this function)
  • 3、make install的错误
    • 错误1:/usr/bin/mkdir -p ""/usr/local/etc/libvirt/nwfilter""
  • 4、检查过程中的错误

1、步骤

感谢提供步骤和错误解决参考:https://www.codeleading.com/article/1288836853/

  • tar -xvf libvirt-4.5.0.tar.xz 【安装包:https://download.libvirt.org/】
  • cd libvirt-4.5.0
  • ./autogen.sh
  • make
  • make install
  • 完成后检查:
    – 查看:virsh list --all
    – 开启libvirt:libvirtd -d
    – 查看是否启动:ps -le | grep libvirtd

2、make过程中的错误

错误1:error: ‘xdr_u_int64_t’ undeclared (first use in this function)

  CCLD     libvirt_secret.laCC       remote/libvirt_driver_remote_la-remote_driver.loCC       remote/libvirt_driver_remote_la-remote_protocol.lo
In file included from remote/remote_protocol.h:18,from remote/remote_protocol.c:7:
remote/remote_protocol.c: In function 'xdr_remote_vcpu_info':
./util/virxdrdefs.h:28:24: warning: implicit declaration of function 'xdr_u_int64_t'; did you mean 'xdr_uint64_t'? [-Wimplicit-function-declaration]#  define xdr_uint64_t xdr_u_int64_t^~~~~~~~~~~~~
remote/remote_protocol.c:272:15: note: in expansion of macro 'xdr_uint64_t'if (!xdr_uint64_t (xdrs, &objp->cpu_time))^~~~~~~~~~~~
./util/virxdrdefs.h:28:24: warning: nested extern declaration of 'xdr_u_int64_t' [-Wnested-externs]#  define xdr_uint64_t xdr_u_int64_t^~~~~~~~~~~~~
remote/remote_protocol.c:272:15: note: in expansion of macro 'xdr_uint64_t'if (!xdr_uint64_t (xdrs, &objp->cpu_time))^~~~~~~~~~~~
remote/remote_protocol.c: In function 'xdr_remote_node_get_cells_free_memory_ret':
./util/virxdrdefs.h:28:24: error: 'xdr_u_int64_t' undeclared (first use in this function); did you mean 'xdr_uint64_t'?#  define xdr_uint64_t xdr_u_int64_t^~~~~~~~~~~~~
remote/remote_protocol.c:664:48: note: in expansion of macro 'xdr_uint64_t'sizeof (uint64_t), (xdrproc_t) xdr_uint64_t))^~~~~~~~~~~~
./util/virxdrdefs.h:28:24: note: each undeclared identifier is reported only once for each function it appears in#  define xdr_uint64_t xdr_u_int64_t^~~~~~~~~~~~~
remote/remote_protocol.c:664:48: note: in expansion of macro 'xdr_uint64_t'sizeof (uint64_t), (xdrproc_t) xdr_uint64_t))^~~~~~~~~~~~
remote/remote_protocol.c: In function 'xdr_remote_node_get_free_pages_ret':
./util/virxdrdefs.h:28:24: error: 'xdr_u_int64_t' undeclared (first use in this function); did you mean 'xdr_uint64_t'?#  define xdr_uint64_t xdr_u_int64_t^~~~~~~~~~~~~
remote/remote_protocol.c:6825:48: note: in expansion of macro 'xdr_uint64_t'sizeof (uint64_t), (xdrproc_t) xdr_uint64_t))^~~~~~~~~~~~
remote/remote_protocol.c: In function 'xdr_remote_node_alloc_pages_args':
./util/virxdrdefs.h:28:24: error: 'xdr_u_int64_t' undeclared (first use in this function); did you mean 'xdr_uint64_t'?#  define xdr_uint64_t xdr_u_int64_t^~~~~~~~~~~~~
remote/remote_protocol.c:6840:48: note: in expansion of macro 'xdr_uint64_t'sizeof (uint64_t), (xdrproc_t) xdr_uint64_t))^~~~~~~~~~~~
make[3]: *** [Makefile:10507: remote/libvirt_driver_remote_la-remote_protocol.lo] Error 1
make[3]: Leaving directory '/home/software/libvirt-3.2.0/libvirt-4.5.0/src'
make[2]: *** [Makefile:6429: all] Error 2
make[2]: Leaving directory '/home/software/libvirt-3.2.0/libvirt-4.5.0/src'
make[1]: *** [Makefile:2107: all-recursive] Error 1
make[1]: Leaving directory '/home/software/libvirt-3.2.0/libvirt-4.5.0'
make: *** [Makefile:2000: all] Error 2

解决:
解决来源:https://listman.redhat.com/archives/libvir-list/2013-May/077764.html
但是这个作者好像不是这一个原因

  • 在“./autogen.sh”后进行操作
  • grep -rn “XDR_CFLAGS =” * 为了查看包含XDR_CFLAGS定义的文件
  • 分别打开Makefilesrc/Makefile文件,找到其中的XDR_CFLAGS = 定义行,添加上-I/usr/include/tirpc
    即:XDR_CFLAGS = -I/usr/include/tirpc
  • 再进行make即可

注:因为我是一起加的,所以不确定是不是只用添加Makefilesrc/Makefile这两个文件其中之一即可,可自行尝试。

3、make install的错误

错误1:/usr/bin/mkdir -p “”/usr/local/etc/libvirt/nwfilter""

解决:

  • **grep -rn “NWFILTER_DIR” *** 【找到nwfilter文件的生成路径】
    在这里插入图片描述
  • 删除2149、2722行多出来的引号

4、检查过程中的错误

参考:https://blog.csdn.net/yang39921/article/details/103296169
非常感谢分享!

http://www.lryc.cn/news/481521.html

相关文章:

  • Jenkins插件使用问题总结
  • u盘怎么重装电脑系统_u盘重装电脑系统步骤和详细教程【新手宝典】
  • Sql server查询数据库表的数量
  • Linux学习笔记之软件包管理RPM与YUM
  • 15分钟学 Go 第 41 天:中间件的使用
  • 《Python 与 SQLite:强大的数据库组合》
  • Golang | Leetcode Golang题解之第552题学生出勤记录II
  • Vue3 常用代码指南手抄,超详细 cheatsheet
  • 结构体是否包含特定类型的成员变量
  • 堆排序与链式二叉树:数据结构与排序算法的双重探索
  • 用 Python 从零开始创建神经网络(四):激活函数(Activation Functions)
  • 使用 Flask 和 ONLYOFFICE 实现文档在线编辑功能
  • 【C++】【算法基础】序列编辑距离
  • 【Android】轮播图——Banner
  • 学SQL,要安装什么软件?
  • webstorm 设置总结
  • 基于Spring Boot的养老保险管理系统的设计与实现,LW+源码+讲解
  • Java | Leetcode Java题解之第541题反转字符串II
  • sql分区
  • [OpenGL]使用OpenGL实现硬阴影效果
  • 嵌入式采集网关(golang版本)
  • ctfshow(328)--XSS漏洞--存储型XSS
  • 【C#】Thread.CurrentThread的用法
  • 简单分享一下淘宝商品数据自动化抓取的技术实现与挑战
  • Netty篇(入门编程)
  • 【渗透测试】payload记录
  • 2024自动驾驶线控底盘行业研究报告
  • css3D变换用法
  • Rust:启动与关闭线程
  • Ubuntu 的 ROS 2 操作系统安装与测试