【发布时间】:2020-03-27 17:52:23
【问题描述】:
我使用 Qt Creator (5.13),我尝试使用 libpcap 创建一些应用程序。当我在一个类中使用 (struct ethhdr *eth) 创建一些方法时,我会得到一个错误:
代码:
void SniffPackets::foo(struct ethhdr *eth){
sprintf(temp_buf, "%3d.%3d.%3d.%3d",
(int)eth->h_dest[0],
(int)eth->h_dest[1],
(int)eth->h_dest[2],
(int)eth->h_dest[3]);
}
错误: 成员访问不完整类型“struct ethhdr *eth”。
顺便说一句,我用的是 c++99
【问题讨论】:
-
` INCLUDEPATH += C:/WpdPack/Include LIBS += -LC:/WpdPack/Lib LIBS += -lwpcap `
-
和标题:#include
-
我意识到,我查看了 Linux 的示例,这个结构在
<net/ethernet.h>中。但我在 Windows 中需要相同的标题。它是什么文件? -
“我使用 c++99” - C++99 不是一门语言。有 C++98 和 C99(等等)。
标签: windows pointers structure libpcap