如何删除“ImageList_Read” : 不一致的dll链接警告?

发布于 2024-09-15 21:58:51 字数 1565 浏览 5 评论 0原文

当我构建 Visual C++ 解决方案 (2005) 时,我收到以下警告

1> c:\winddk\7000.0.winmain_win7beta.081212-1400\inc\api\commctrl.h(678) :参见 'ImageList_Read' 的先前定义

1>e:\xml parse\development\gui\h\wtl4mfc.h(6 ) : 警告 C4273: 'ImageList_Write' : dll 链接不一致

1> c:\winddk\7000.0.winmain_win7beta.081212-1400\inc\api\commctrl.h(679) :参见 'ImageList_Write'

1>e:\xml parse\development\gui\h\wtl4mfc.h(8 ) : 警告 C4273: 'ImageList_ReadEx' : dll 链接不一致

1> c:\winddk\7000.0.winmain_win7beta.081212-1400\inc\api\commctrl.h(686) :参见 'ImageList_ReadEx'

1>e:\xml parse\development\gui\h\wtl4mfc.h(9 ) : 警告 C4273: 'ImageList_WriteEx' : dll 链接不一致

1> c:\winddk\7000.0.winmain_win7beta.081212-1400\inc\api\commctrl.h(687) :参见 'ImageList_WriteEx' 的先前定义

当我检查这两个文件时,我可以看到以下内容:

****在wtl4mfc中.h****

外部“C” { HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm); BOOL WINAPI ImageList_Write(HIMAGELIST Himl, LPSTREAM pstm);

#if (_WIN32_WINNT >= 0x0501) HRESULT WINAPI ImageList_ReadEx(DWORD dwFlags, LPSTREAM pstm, REFIID riid, PVOID* ppv); HRESULT WINAPI ImageList_WriteEx(HIMAGELIST Himl, DWORD dwFlags, LPSTREAM pstm);

#endif };

在 commctrl.h 文件中,我可以看到以下内容:

WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(__in struct IStream *pstm); WINCOMMCTRLAPI BOOL WINAPI ImageList_Write(__in HIMAGELIST Himl, __in struct IStream *pstm);

我是 Visual C++ 的初学者,这是来自可供我维护的代码。我怎样才能删除这些警告?如果我构建安装了较低版本 Winddk 的代码,则不会显示这些警告。

是什么导致这些警告?我怎样才能删除它们?

When I build my Visual C++ Solution ( 2005), I get the following warnings

1> c:\winddk\7000.0.winmain_win7beta.081212-1400\inc\api\commctrl.h(678) : see previous definition of 'ImageList_Read'

1>e:\xml parse\development\gui\h\wtl4mfc.h(6) : warning C4273: 'ImageList_Write' : inconsistent dll linkage

1> c:\winddk\7000.0.winmain_win7beta.081212-1400\inc\api\commctrl.h(679) : see previous definition of 'ImageList_Write'

1>e:\xml parse\development\gui\h\wtl4mfc.h(8) : warning C4273: 'ImageList_ReadEx' : inconsistent dll linkage

1> c:\winddk\7000.0.winmain_win7beta.081212-1400\inc\api\commctrl.h(686) : see previous definition of 'ImageList_ReadEx'

1>e:\xml parse\development\gui\h\wtl4mfc.h(9) : warning C4273: 'ImageList_WriteEx' : inconsistent dll linkage

1> c:\winddk\7000.0.winmain_win7beta.081212-1400\inc\api\commctrl.h(687) : see previous definition of 'ImageList_WriteEx'

When I checked these two files, I can see the following:

****In wtl4mfc.h****

extern "C"
{
HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
BOOL WINAPI ImageList_Write(HIMAGELIST himl, LPSTREAM pstm);

#if (_WIN32_WINNT >= 0x0501)
HRESULT WINAPI ImageList_ReadEx(DWORD dwFlags, LPSTREAM pstm, REFIID riid, PVOID* ppv);
HRESULT WINAPI ImageList_WriteEx(HIMAGELIST himl, DWORD dwFlags, LPSTREAM pstm);

#endif
};

In commctrl.h file I can see the following:

WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(__in struct IStream *pstm);
WINCOMMCTRLAPI BOOL WINAPI ImageList_Write(__in HIMAGELIST himl, __in struct IStream *pstm);

I am a beginner in Visual C++ and this is from a code which is available for me to maintain. How can I remove these warnings? These warnings are not shown if I build the code where lower version of Winddk is installed.

What is causing these warnings? How can I remove them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

墨落画卷 2024-09-22 21:58:51

该警告来自两个具有不同 __declspec 的声明。我希望 WINCOMMCTRLAPI 隐藏 __declspec 属性。

要修复它,首先检查您是否需要包含这两个声明 - 也许不同的源文件错误地选择了不同的包含路径?还是直接包含旧版本?其次检查您的构建中是否定义了影响 WINCOMMCTRLAPI 扩展方式的宏。可能是项目设置设置错误。

That warning comes from having two declarations that have different __declspec. I expect WINCOMMCTRLAPI hides a __declspec attribute.

To fix it, first check that you need to get both of those declarations included - perhaps different source files are picking up different include paths erroneously? Or directly including an old version? Second check if there is a macro defined in your build that affects how WINCOMMCTRLAPI is expanded. It may be there is a project setting that has got set wrong.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文