用Release链接时出现错误:
error LNK2001: unresolved external symbol __imp__InternetGetConnectedState@8
而Debug链接无问题有人说动态连接库导出函数没有外部声明
我不太明白,应该怎么声明啊?请教

解决方案 »

  1.   

    你就有可能再Directory中没有包含你所引用的外部文件的路径,具体可以看MSDN的LNK2001错unresolved external symbol "symbol"Code will generate this error message if it references something (like a function, variable, or label) that the linker can’t find in all the libraries and object files it searches. In general, there are two reasons this error occurs: what the code asks for doesn’t exist (the symbol is spelled incorrectly or uses the wrong case, for example), or the code asks for the wrong thing (you are using mixed versions of the libraries?some from one version of the product, others from another version). 
      

  2.   

    菜单:project->setting->link: module/libaray 中加入Wininet.lib
      

  3.   

    #pragma comment(lib,"Wininet.lib")
      

  4.   

    #pragma comment(lib,"Wininet.lib")
      

  5.   

    菜单:project->setting->link: module/libaray 中加入Wininet.lib