现在的位置: 首页 > 综合 > 正文

出现link错误,说找不到IPHlpApi.Lib(VC6.0)

2013年01月14日 ⁄ 综合 ⁄ 共 1317字 ⁄ 字号 评论关闭

开始做网络第二次作业,想运行winpcap给出的示例程序

安装好winpcap驱动,重启,在vc include、lib中设置了wpdpack的目录后运行

报link错误,找不到IPHlpApi.Lib,应该是没有设置这个库的链接路径,所以使用不了

上网搜索答案

1.最好的办法是上microsoft的website找一个platformSDK for internet的东西安装(大约有140m)

2. VC2003 和 VC2005默认都安装了Platform SDK的,里面自己就会带这两个文件 ,

VC6的用户需要自己安装Platform SDK for internet,大概140MB左右

搜索我用的电脑,E:"Program Files"Microsoft Platform SDK for Windows XP SP2"Lib中就有IPHlpApi

看来我的sdk是安装了

所以在vc6.0中

Tools -> Option -> Directories,在Library files里加入路径E:"Program Files"Microsoft Platform SDK for Windows XP SP2"Lib

在Include files里加入路径E:"Program Files"Microsoft Platform SDK for Windows XP SP2"INCLUDE

就可以了

如果遇到报错

e:"netmanage2"platformsdk"include"ipexport.h(39) : error C2371: 'IN6_ADDR' : redefinition; different basic types
??????? c:"program files"microsoft visual studio"vc98"include"ws2tcpip.h(68) : see declaration of 'IN6_ADDR'

或者可能是
:"netmanage2"platformsdk"include"ras.h(282) : error C2146: syntax error : missing ';' before identifier 'reserved'
e:"netmanage2"platformsdk"include"ras.h(282) : error C2501: 'ULONG_PTR' : missing storage-class or type specifiers
e:"netmanage2"platformsdk"include"ras.h(282) : error C2501: 'reserved' : missing storage-class or type specifiers
e:"netmanage2"platformsdk"include"ras.h(722) : error C2065: 'ULONG_PTR' : undeclared identifier
是由于经常要用到platform SDk,同时VC自己有SDK,这两个SDK一起用时会冲突的问题
此时,你只需要将该workspace选中,然后clean,再将INCLUDE中PSDK放到最前面即可
这一点我弄了好久,如果不clean,仅仅将PSDK放最前,会报第二种错误,PSDK不在前,会报第一种错
【上篇】
【下篇】

抱歉!评论已关闭.