使用 Cygwin 定位头文件
我正在使用 cygwin 并尝试设置 Winpcap。我有以下示例目录结构:
/a/basic_dump.c
/a/pcap.h
/usr/include/pcap/pcap.h
>
basic_dump.c 文件有 #include "pcap.h"
(它找到了)。 /a/pcap.h 文件具有 #include
。
在 /a 目录中,我执行 gcc -c basic_dump.c
。但是,我得到pcap/pcap.h:没有这样的文件或目录
。
我也尝试过使用 -I /usr/include/pcap
和 -I /usr/include
但没有运气。
任何帮助表示赞赏。 谢谢
I'm using cygwin and trying to set up Winpcap. I have the following sample directory structure:
/a/basic_dump.c
/a/pcap.h
/usr/include/pcap/pcap.h
The basic_dump.c file has #include "pcap.h"
(which it finds). The /a/pcap.h file has #include <pcap/pcap.h>
.
Withing the /a directory, I execute gcc -c basic_dump.c
. However, I get pcap/pcap.h: no such file or directory
.
I've also tried using -I /usr/include/pcap
and -I /usr/include
but no luck.
Any help is appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试以下操作:
本教程介绍了如何使用 < 编写和编译 C 程序code>libpcap 这对你来说是一个很好的参考。
Try the following:
This tutorial explains how to write and compile C programs with
libpcap
which can be a good reference for you.尝试删除
-I
和包含路径之间的空格。Try removing the space between
-I
and the path to your includes.