在 Ubuntu 上编译 Wireshark 输出许多重新声明错误

在 Ubuntu 上编译 Wireshark 输出许多重新声明错误

我正在尝试在 Ubuntu 中为 ZBOSS 安装 Wireshark

当我尝试重建时,出现此错误:

In file included from /usr/include/glib-2.0/glib/gdir.h:32:0,
                 from /usr/include/glib-2.0/glib.h:45,
                 from packet-gluster_cli.c:38:
packet-gluster.h:359:2: error: redeclaration of enumerator 'DT_UNKNOWN'
  DT_UNKNOWN = 0,
  ^
/usr/include/dirent.h:99:5: note: previous definition of 'DT_UNKNOWN' was here
     DT_UNKNOWN = 0,
     ^
packet-gluster.h:360:2: error: redeclaration of enumerator 'DT_FIFO'
  DT_FIFO = 1,
  ^
/usr/include/dirent.h:101:5: note: previous definition of 'DT_FIFO' was here
     DT_FIFO = 1,
     ^
packet-gluster.h:361:2: error: redeclaration of enumerator 'DT_CHR'
  DT_CHR = 2,
  ^
/usr/include/dirent.h:103:5: note: previous definition of 'DT_CHR' was here
     DT_CHR = 2,
     ^
packet-gluster.h:362:2: error: redeclaration of enumerator 'DT_DIR'
  DT_DIR = 4,
  ^
/usr/include/dirent.h:105:5: note: previous definition of 'DT_DIR' was here
     DT_DIR = 4,
     ^
packet-gluster.h:363:2: error: redeclaration of enumerator 'DT_BLK'
  DT_BLK = 6,
  ^
/usr/include/dirent.h:107:5: note: previous definition of 'DT_BLK' was here
     DT_BLK = 6,
     ^
packet-gluster.h:364:2: error: redeclaration of enumerator 'DT_REG'
  DT_REG = 8,
  ^
/usr/include/dirent.h:109:5: note: previous definition of 'DT_REG' was here
     DT_REG = 8,
     ^
packet-gluster.h:365:2: error: redeclaration of enumerator 'DT_LNK'
  DT_LNK = 10,
  ^
/usr/include/dirent.h:111:5: note: previous definition of 'DT_LNK' was here
     DT_LNK = 10,
     ^
...
...
packet-gluster.h:365:2: error: redeclaration of enumerator 'DT_LNK'
  DT_LNK = 10,
  ^
/usr/include/dirent.h:111:5: note: previous definition of 'DT_LNK' was here
     DT_LNK = 10,
     ^
packet-gluster.h:366:2: error: redeclaration of enumerator 'DT_SOCK'
  DT_SOCK = 12,
  ^
/usr/include/dirent.h:113:5: note: previous definition of 'DT_SOCK' was here
     DT_SOCK = 12,
     ^
packet-gluster.h:367:2: error: redeclaration of enumerator 'DT_WHT'
  DT_WHT = 14
  ^
/usr/include/dirent.h:115:5: note: previous definition of 'DT_WHT' was here
     DT_WHT = 14
     ^
Makefile:6923 : la recette pour la cible « libdissectors_la-packet-gluster_pmap.lo » a échouée
make[5]: *** [libdissectors_la-packet-gluster_pmap.lo] Erreur 1

知道如何解决吗?

答案1

我在 Ubuntu 18.04 上尝试编译 Wireshark 1.8.8 时遇到了此错误。我能够使用本文中提到的修复方法成功编译 wireshark关联。这些修复针对的是 Fedora 25,但是我测试了一下,它在 Ubuntu 18.04 上也能正常工作。

这里我列出了成功编译所需的部分参考(请注意,其他版本的行号可能不同)。第一个解决了您的问题,但是之后还会出现其他(独立)问题,这些问题可以通过列出的其他两项来解决。

  • 编辑epan/dissectors/packet-gluster.h第 357 行并gluster_entry_types彻底删除枚举。
  • g_memmove复制 第 81 行的 定义packaging/macosx/native-gtk/glibconfig.h并将其粘贴到文件ui/gtk/export_object_smb.c和的第一行。为方便起见,epan/dissectors/packet-ssl-utils.c这里是 的定义: 。g_memmove#define g_memmove(dest,src,len) G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END
  • 更新文件并用 仅包含 ASCII 字符的字符串AUTHORS替换名称和。Peter KovářPeter KovarРоман ДонченкоRoman Donchenko

相关内容