“错误:”struct udphdr” 没有名为“source”的成员 ...嗯?
我正在尝试编译一个名为 ngrep 的程序,当我运行 configure 时,一切似乎都很顺利,但是当我运行 make 时,我得到:
ngrep.c: In function ‘process’:
ngrep.c:544: error: ‘struct udphdr’ has no member named ‘source’
ngrep.c:545: error: ‘struct udphdr’ has no member named ‘dest’
make: *** [ngrep.o] Error 1
这是什么意思,我该如何修复它? 没有任何早期警告或错误表明问题的根源。
I'm trying to compile a program called ngrep, and when I ran configure, things seemed to go well, but when I run make, I get:
ngrep.c: In function ‘process’:
ngrep.c:544: error: ‘struct udphdr’ has no member named ‘source’
ngrep.c:545: error: ‘struct udphdr’ has no member named ‘dest’
make: *** [ngrep.o] Error 1
What does that mean, and how do I fix it? There are no earlier warnings or errors that suggest the root of the problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
发现问题:
显然,configure在这个测试中有一个bug,它认为我的系统有“哑”udphdr,尽管它没有。 将第一行更改为“#if 0”可以解决该问题。
Found the problem:
Apparently, configure has a bug in this test, and it thinks my system has the "dumb" udphdr, even though it doesn't. Changing the first line to "#if 0" fixes the problem.
嗯,有一个名为 udphdr 的结构(可能是 udp header 的缩写)。 程序的某些部分假设该结构具有成员 source 和 dest,但它没有。
查看文件 ngrep.c 第 544 行和第 545 行以查找有问题的行。
可能原因:
编辑:可能相关的问题: http://ubuntuforums.org/showthread.php?t=371871< /a>
Well, there is a struct called udphdr (probably short for udp header). And some part of the program assumes the struct has the members source and dest which it hasn't.
Look at file ngrep.c line 544 and 545 to find the offending lines.
Possible causes:
Edit: probably related problem: http://ubuntuforums.org/showthread.php?t=371871