#include<windows.h> Problem
-
Hi!
Ich möchte gerne die Header Datei windows.h in mein Projekt (Windows Forms Anwendung unter Visual Studio 2008) einbinden und bekomme jede Menge Fehlermeldungen, die ich nicht so recht interpretieren kann.
Kann jemand helfen. Besten Dank.
Hier die Compiler Ausschrift:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5934) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(251) : System::Windows::Forms::IDataObject IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5934) : error C3699: '' : cannot use this indirection on type 'IDataObject'
1> compiler replacing '' with '^' to continue parsing
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : error C2371: 'IDataObject' : redefinition; different basic types
1> C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(251) : see declaration of 'IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6110) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6123) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6136) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6171) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6184) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6282) : error C2872: 'IMessageFilter' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(263) : System::Windows::Forms::IMessageFilter IMessageFilter'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IMessageFilter'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6282) : error C3699: '' : cannot use this indirection on type 'IMessageFilter'
1> compiler replacing '' with '^' to continue parsing
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(6328) : error C2371: 'IMessageFilter' : redefinition; different basic types
1> C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(263) : see declaration of 'IMessageFilter'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12671) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12677) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12682) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12688) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12693) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(12700) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(374) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(1151) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(1157) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3288) : error C2872: 'IDropTarget' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(173) : System::Windows::Forms::IDropTarget IDropTarget'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDropTarget'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3288) : error C3699: '' : cannot use this indirection on type 'IDropTarget'
1> compiler replacing '' with '^' to continue parsing
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3328) : error C2371: 'IDropTarget' : redefinition; different basic types
1> c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(173) : see declaration of 'IDropTarget'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3332) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3345) : error C2872: 'IDataObject' : ambiguous symbol
1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : IDataObject'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(96) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(53) : System::IServiceProvider IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(96) : error C3699: '' : cannot use this indirection on type 'IServiceProvider'
1> compiler replacing '' with '^' to continue parsing
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : error C2371: 'IServiceProvider' : redefinition; different basic types
1> c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(53) : see declaration of 'IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(120) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(235) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(242) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>c:\program files\microsoft sdks\windows\v6.0a\include\msxml.h(1436) : error C2143: syntax error : missing ')' before 'constant'
1>c:\program files\microsoft sdks\windows\v6.0a\include\msxml.h(1436) : error C2143: syntax error : missing ';' before 'constant'
1>c:\program files\microsoft sdks\windows\v6.0a\include\msxml.h(1436) : error C2059: syntax error : ')'
1>c:\program files\microsoft sdks\windows\v6.0a\include\msxml.h(1436) : error C2238: unexpected token(s) preceding ';'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\urlmon.h(5854) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\urlmon.h(5856) : error C2872: 'IServiceProvider' : ambiguous symbol
1> could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(103) : IServiceProvider'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'
-
Hi
Suche im C++/CLI Forum (http://www.c-plusplus.net/forum/viewforum-var-f-is-58.html) nach IDataObject. Es gibt schon eine Menge Posts zu diesem Problem. Im wesentlichen ist das Problem eine Namenskollision.
Simon
-
Danke für den Tip!
Jetzt funktionierts.
Es fehlte eine define-Anweisung.