www.cnblogs.com/ruiyqinrui

开源、架构、Linux C/C++/python AI BI 运维开发自动化运维。 春风桃李花 秋雨梧桐叶。“力尽不知热 但惜夏日长”。夏不惜,秋不获。@ruiY--秦瑞

python爬虫,C编程,嵌入式开发.hadoop大数据,桉树,onenebula云计算架构.linux运维及驱动开发.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  2912 随笔 :: 9 文章 :: 51 评论 :: 185万 阅读

ext3grep 版本:ext3grep-0.10.2.tar.gz  

操作系统centos 7 

产生原因:测试恢复被删除的文件

产生错误提示如下:

[root@localhost ext3grep-0.10.2]# make
make  all-recursive
make[1]: 进入目录“/data/recovery/ext3grep-0.10.2”
Making all in src
make[2]: 进入目录“/data/recovery/ext3grep-0.10.2/src”
g++ -Iempty.pch.h -DHAVE_CONFIG_H -I. -I..    -g -O2 -DUSE_MMAP=1 -I/usr/include/ext2fs -I/usr/include/et    -include pch.h \
  -c -o pch.h.gch/6145d4709c827f9d2a94d7691c87ab4e ./pch-source.h
In file included from ./pch-source.h:43:0:
./ext3.h: 在成员函数‘__u32 Inode::reserved2() const’中:
./ext3.h:113:42: 错误:‘i_reserved2’在此作用域中尚未声明
     __u32 reserved2(void) const { return i_reserved2; }
                                          ^
./ext3.h: 在成员函数‘void Inode::set_reserved2(__u32)’中:
./ext3.h:115:37: 错误:‘i_reserved2’在此作用域中尚未声明
     void set_reserved2(__u32 val) { i_reserved2 = val; }
                                     ^
make[2]: *** [pch.h.gch/6145d4709c827f9d2a94d7691c87ab4e] 错误 1
make[2]: 离开目录“/data/recovery/ext3grep-0.10.2/src”
make[1]: *** [all-recursive] 错误 1
make[1]: 离开目录“/data/recovery/ext3grep-0.10.2”
make: *** [all] 错误 2

解决方法: (在对应的地方,将+后面的内容补充到ext3.h中

[root@localhost ext3grep-0.10.2]# vim src/ext3.h 

可以参考@@后面的行号添加红色标出的内容差异(正式添加时去掉前边的加号):

diff -ur ext3grep-0.10.1/src/ext3.h ext3grep-0.10.1.new/src/ext3.h
--- ext3grep-0.10.1/src/ext3.h2008-04-09 11:20:31.000000000 +0000
+++ ext3grep-0.10.1.new/src/ext3.h2011-12-10 07:00:50.000000000 +0000
@@ -24,6 +24,17 @@
 #ifndef EXT3_H
 #define EXT3_H
 
+// this trickery needs to happen before ext2_fs is included so
+// bail out if it has already been included by another path
+#ifdef _LINUX_EXT2_FS_H
+  #error please include this file before any other includes of ext2fs/ext2_fs.h
+#endif
+
+// some versions of the ext2 headers call this s_frags_per_group and some
+// call it s_clusters_per_group, define one to the other so our code works 
+// with both
+#define s_clusters_per_group s_frags_per_group
+
 // Use the header files from e2progs (http://e2fsprogs.sourceforge.net)
 // We can use these headers and then everything named ext2 or ext3.
 #include <ext2fs/ext2_fs.h>// Definitions of ext2, ext3 and ext4.
@@ -110,6 +121,12 @@
     __u32 faddr(void) const { return i_faddr; }
     __u16 uid_high(void) const { return i_uid_high; }
     __u16 gid_high(void) const { return i_gid_high; }
+#ifndef i_reseved2
+    //i_reseved2 has been split into two fields in recent 
+    //versions of the headers, luckilly we can still access
+    //it in one peice through the hurd side of the union
+    #define i_reserved2 osd2.hurd2.h_i_author
+#endif
     __u32 reserved2(void) const { return i_reserved2; }
 
     void set_reserved2(__u32 val) { i_reserved2 = val; }

保存退出继续安装,错误消失。

posted on   秦瑞It行程实录  阅读(94)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
历史上的今天:
2020-07-29 kolla-ansible-x
2020-07-29 CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release
2020-07-29 kolla-ansible
2015-07-29 git init CLI
2015-07-29 ganglia
2015-07-29 yum ganglia
www.cnblogs.com/ruiyqinrui
点击右上角即可分享
微信分享提示