我在一个ATL工程里要使用InternetGetCookie函数,就添加了
#include <wininet.h> 
编译时发生以下错误:
----------------------------------------------------------
Linking...
   Creating library Debug/VNetPassportCom.lib and object Debug/VNetPassportCom.exp
Passport.obj : error LNK2001: unresolved external symbol __imp__InternetGetCookieA@16
Debug/VNetPassportCom.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
--------------------------------------------------------
请问是怎么回事啊?

解决方案 »

  1.   

    lib文件呢?有没有在工程设置里加
      

  2.   

    Project->Settings->Link->General,在Object/Library Modules 中加入VNetPassportCom.lib
      

  3.   

    project->setting->link 下加上Wininet.lib文件
      

  4.   

    TO laiyiling(最熟悉的陌生人) :加上#import <wininet.lib>时出错:
    ----------------------------------------
    d:\vsprojects\vnetpassportcom\stdafx.h(26) : fatal error C1083: Cannot open type library file: 'wininet.lib': 加载类型库/DLL 时出错。
    ----------------------------------------我的机子先装了.net,然后装的VC6,是不是wininet.dll版本不一样啊?
      

  5.   

    有啊,路径是C:\Program Files\Microsoft Visual Studio\VC98\Lib\wininet.lib
      

  6.   

    我把wininet.lib拷到debug目录下,再在工程设置里添加了引用,现在不报错了,但是不知道能不能用