cygwin下编译icmp相关代码(缺少“icmp”结构体)
我正在使用 cygwin 编译网络工具(iffinder)。
在 ./configure
和 make
之后,我遇到了一个问题,我猜与 struct icmp
有关。头文件中的 icmp 结构在哪里。我在cygwin头文件中搜索了它,但没有找到任何东西。
如何在cygwin中编译需要icmp
的源代码?
如果有帮助,你可以找到iffinder的源代码此处
注意:我的 cygwin 中有 ip_icmp.h
标头文件。
编译错误:
iffinder.c:1059: 警告:“struct icmp”在参数列表中声明
iffinder.c:1059: 警告:其范围仅限于此定义或
声明,这可能不是你想要的 iffinder.c: In
函数“handle_icmp_error”:iffinder.c:1069:错误:取消引用
指向不完整类型的指针
...
I'm using cygwin to compile a network tool(iffinder).
After ./configure
and make
i have a problem that i guess is related to struct icmp
. Where is the icmp
struct in header files. I searched for it in cygwin header files, but i didn't find anything.
How can i compile source codes which need icmp
, in cygwin?
If it helps, you can find the source code of iffinder here
Note: I have ip_icmp.h
in my cygwin's header files.
Compile error:
iffinder.c:1059: warning: "struct icmp" declared inside parameter list
iffinder.c:1059: warning: its scope is only this definition or
declaration, which is probably not what you want iffinder.c: In
function `handle_icmp_error': iffinder.c:1069: error: dereferencing
pointer to incomplete type
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 cygwin 中,
icmp.h
为空。我建议您从开源项目中复制 icmp.h,并在您的项目中编译它。也许,你有很多错误,你必须纠正它们,但你只需要一个 icmp 结构,它就能解决你的问题。In cygwin, the
icmp.h
is empty. I suggest you copy a icmp.h from a open source project, and compile it with your project. Maybe, you have many errors and you have to correct them, but you just need an icmp struct and it will solve your problem.iffinder.c
第 54 行是否#include
- 您的系统上是否存在此头文件?iffinder.c
line 54 does#include <netinet/ip_icmp.h>
- is this header file present on your system?