环境是VC++6.0,winpcap,已配置好,打算做一个arp包的发送工具,在使用Windows API获取网卡信息时,编译出现问题:
#ifndef WIN32_LEAN_AND_MEAN[]()
#define WIN32_LEAN_AND_MEAN
#endif
#include <stdio.h>
#include <stdlib.h>
#include "pcap.h"
#include <string.h>
#include <WinSock2.h>
#include <Iphlpapi.h>//加入这个头文件时发生错误
#include <iostream>
#pragma comment(lib,"Iphlpapi.lib") //需要添加Iphlpapi.lib库
using namespace std;
//后面的代码省略。。。
编译时出现如下错误:
c:\program files (x86)\microsoft visual studio\vc98\include\ipexport.h(39) : error C2371: 'IN6_ADDR' : redefinition; different basic types c:\program files (x86)\microsoft visual studio\vc98\include\ws2tcpip.h(68) : see declaration of 'IN6_ADDR'