我在把一个控件编译为ReleaseMinDependency时,下面一些函数出现如下问题,
error LNK2001: unresolved external symbol __imp__ImageList_LoadImageA@28
error LNK2001: unresolved external symbol __imp__ImageList_DrawIndirect@4
error LNK2001: unresolved external symbol __imp__ImageList_DrawIndirect@4
error LNK2001: unresolved external symbol __imp__ImageList_GetImageInfo@12
error LNK2001: unresolved external symbol __imp__ImageList_GetImageInfo@12
error LNK2001: unresolved external symbol __imp__ImageList_GetImageCount@4微软这样说:
The Microsoft® Win32® application programming interface (API) provides image list functions that enable you to create and destroy image lists, add and remove images, replace and merge images, draw images, and drag images. To use the image list functions, include the common control header file in your source code files and link with the common control export library. In addition, before calling any image list function, use the InitCommonControls function to ensure that the common control dynamic-link library (DLL) is loaded. 我不知道该怎么解决。
help me please.

解决方案 »

  1.   

    To use the image list functions, include the common control header file in your source code files and link with the common control export library
    -----------------------------------
    你包含这个library了吗?
      

  2.   

    在Alt+F7的Link的选项卡中的下面的编辑框中添加这个库:comctl32.lib
      

  3.   

    #include "commctrl.h"
    #pragma comment(lib, "comctl32.lib")
      

  4.   

    __imp__ImageList_LoadImageA@28
    __imp__ImageList_DrawIndirect@4
    __imp__ImageList_DrawIndirect@4
    __imp__ImageList_GetImageInfo@12
    __imp__ImageList_GetImageInfo@12
    __imp__ImageList_GetImageCount@4
    这些函数是从.idl文件生成的接口函数的proxy/stub函数,函数定义在.idl文件用midl编译后生成的xxxx_c.c中,把这个文件用cl编译后生成.obj文件。
    你的工程要连接这个.obj文件,才能连接进proxy/stub代码。
    通常情况下,工程会设置为自动连接进这个obj文件。
    出现这个错误可能是你的设置参数有问题。