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

开始做网络第二次作业,想运行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不在前,会报第一种错

转载于:https://www.cnblogs.com/alexusli/archive/2009/01/07/1370982.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值