【发布时间】:2012-02-26 03:35:26
【问题描述】:
我目前正在将一个 C++ 项目从 VS6 迁移到 VS2008,但是对于 shobjidl.h 中的许多函数,我遇到了以下错误
error C2733: second C linkage of overloaded function 'HWND_UserMarshal' not allowed c:\program files\microsoft sdks\windows\v6.0a\include\shobjidl.h 28830
不只是 HWND_UserMarshall 受到影响,此头中的其他函数也受到影响,例如 HWND_UserSize、HWND_UserFree 和 HWND_UserFree64。
我了解当使用一组不同的参数声明 extern "C" 函数时会发生此错误,但这是在 SDK 标头中,我无法更改。
有人对我的下一步应该做什么有任何建议吗?
编辑:标题是 Microsoft 标题,顶部包含以下 cmets
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 7.00.0499 */
/* Compiler settings for shobjidl.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
【问题讨论】:
-
就像 Max 所说的那样,可能有一个宏或 #define 某处导致了问题。尝试找出包含该标题的位置,看看是否有任何明显的地方。
标签: c++ visual-studio visual-studio-2008 visual-c++ linker