Skip to content

Fix MSXML2 include errors in application build - #26

Open
SSimboeckMesu wants to merge 1 commit into
jezhiggins:mainfrom
SSimboeckMesu:patch-1
Open

Fix MSXML2 include errors in application build#26
SSimboeckMesu wants to merge 1 commit into
jezhiggins:mainfrom
SSimboeckMesu:patch-1

Conversation

@SSimboeckMesu

Copy link
Copy Markdown
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml2.h(48): error C2146: syntax error: missing ';' before identifier 'IXMLDOMImplementation'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml2.h(55): error C2146: syntax error: missing ';' before identifier 'IXMLDOMNode'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml2.h(62): error C2146: syntax error: missing ';' before identifier 'IXMLDOMDocumentFragment'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml2.h(69): error C2146: syntax error: missing ';' before identifier 'IXMLDOMDocument'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml2.h(76): error C2146: syntax error: missing ';' before identifier 'IXMLDOMDocument2'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml2.h(83): error C2146: syntax error: missing ';' before identifier 'IXMLDOMDocument3'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml2.h(90): error C2146: syntax error: missing ';' before identifier 'IXMLDOMNodeList'
...
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml.h(614): error C2371: 'IXMLDOMNode': redefinition; different basic types
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml2.h(55): note: see declaration of 'IXMLDOMNode'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml.h(1159): error C2371: 'IXMLDOMDocumentFragment': redefinition; different basic types
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml2.h(62): note: see declaration of 'IXMLDOMDocumentFragment'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml.h(1586): error C2371: 'IXMLDOMDocument': redefinition; different basic types
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml2.h(69): note: see declaration of 'IXMLDOMDocument'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml.h(2404): error C2371: 'IXMLDOMNodeList': redefinition; different basic types
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\msxml2.h(90): note: see declaration of 'IXMLDOMNodeList'
...

I got these error messages in my application (CMake + Visual Studio 2026) because <windows.h> and <objbase.h> need to be included before <msxml2.h>.

These errors do not occur when building the library. It only occur when the application includes the header files directly.

Including <msxml2.h> directly in the application caused C2146/C2371 errors due to missing definitions. These errors do not occur when building the library itself.

Including <windows.h> and <objbase.h> before <msxml2.h> solves this problem by ensuring that all required types are defined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant