wxWidgets链接程序中的Microsoft SDK编译器错误C2332和C2011

我在编译Windows 7计算机上的Visual Studio 2010中的程序时出现问题。 当我在发布模式下编译时遇到下面的错误,但不是在debugging模式下。 我仔细地检查了两种模式的所有属性设置,它们是相同的,除了它们必须不同的地方。 代码生成设置为运行时/ MD,debugging/ MDd,我编译wxWidgets(2.8.12)库的设置和wxWidgets库的名称略有不同。 正如我所说,我没有问题编译和运行我的程序在debugging模式下,或运行wxWidgets样品在任一模式。 我也链接到wxMathPlot,这是一个wxWidgets插件,我不知道这是否是相关的。 我可以运行wxMathPlot示例的debugging版本或发行版本。

现在微软对这些编译器错误有一些信息,但没有什么帮助我太多:

http://msdn.microsoft.com/en-us/library/3ys51zwc(v=vs.71).aspx http://msdn.microsoft.com/en-us/library/sksadsda.aspx

这个陈述似乎是相关的:“如果您不止一次地将types库导入到同一个文件中,您也可能得到C2011”

除了我不知道这是什么意思,或者我怎么可能这样做。 似乎好奇的是,我会为了一种模式而不是另一种模式。 有没有人看到这个问题,并知道如何克服它?

谢谢菲尔

1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(124): error C2332: 'class' : missing tag name 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(124): error C2011: '<unnamed-tag>' : 'enum' type redefinition 1> C:\WXWIDGETS\wxWidgets-2.8.12\include\wx/app.h(48) : see declaration of '<unnamed-tag>' 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(124): error C2059: syntax error : 'constant' 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(125): error C2143: syntax error : missing ')' before '>' 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(131): error C2065: 'pp' : undeclared identifier 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(134): warning C4229: anachronism used : modifiers on data are ignored 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(134): error C2365: 'IUnknown::QueryInterface' : redefinition; previous definition was 'member function' 1> C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(116) : see declaration of 'IUnknown::QueryInterface' 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(134): error C2998: 'HRESULT QueryInterface' : cannot be a template definition 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(316): error C2989: 'AsyncIUnknown' : class template has already been declared as a non-class template 1> C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(59) : see declaration of 'AsyncIUnknown' 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(434): error C2989: 'IClassFactory' : class template has already been declared as a non-class template 1> C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(65) : see declaration of 'IClassFactory' 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\objidl.h(269): error C2989: 'IRpcChannelBuffer' : class template has already been declared as a non-class template 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\rpcndr.h(708) : see declaration of 'IRpcChannelBuffer' 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\objidl.h(305): error C2989: 'IRpcStubBuffer' : class template has already been declared as a non-class template 1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\rpcndr.h(2489) : see declaration of 'IRpcStubBuffer' 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\objidl.h(653): error C2143: syntax error : missing ';' before 'identifier' 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\objidl.h(653): warning C4091: 'typedef ' : ignored on left of '_COSERVERINFO' when no variable is declared 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\objidl.h(653): fatal error C1075: end of file found before the left brace '{' at 'C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\objidl.h(595)' was matched 

下面是一段代码,它从第124行开始的unknwn.h文件中抱怨:

 template<class Q> HRESULT #ifdef _M_CEE_PURE __clrcall #else STDMETHODCALLTYPE #endif QueryInterface(Q** pp) { return QueryInterface(__uuidof(Q), (void **)pp); }