我在测试别人的代码时用到 GetFileVersionInfo,奇怪的是用他的源代码测试时没有问题,把他的代码拷贝到我的工程中就出现:error LNK2019:无法解析的外部符号 _GetFileVersionInfoA@16 错误。我仔细检查了我与他的头文件都一样,怎么我这里就编译通不过?而且GetFileVersionInfo在错误提示中变成了_GetFileVersionInfoA@16

解决方案 »

  1.   

    Requirements 
      Windows NT/2000/XP: Included in Windows NT 3.1 and later.
      Windows 95/98/Me: Included in Windows 95 and later.
      Header: Declared in Winver.h; include Windows.h.
      Library: Use Version.lib.
    把Version.lib加到你的工程里面
    在project->setting 里面的link里面的input
    里面加上
      

  2.   

    Requirements Runs on Versions Defined in Include Link to 
    Windows CE OS 3.0 and later Winbase.h     Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API._GetFileVersionInfoA@16计算机会把函数翻译成这个样子的
    A表示是Ansi的
    好象是W表示unicode
      

  3.   

    多谢,我用的是VS.net 2003中文版,正在摸索怎么加入 .lib
      

  4.   

    需要link进Version.lib不然加代码:
    #Pragma comment(lib,"Version.lib")
      

  5.   

    这个 Version.lib 在哪里? 正搜索中。