title: VS 2010 Compile error in SDK include headers
body: <p>I had one problem when compiling code with VS2010. I got the following 100+ errors with the SDK headers. When I compiled the exact same code with VS2013 and V120, it worked fine. 
  I found similar problem on following link but it didn't work. 
  [<a href="https://stackoverflow.com/questions/11000342/visual-studio-2010-and-windows-sdk-7-0a-compilation-error]">Visual Studio 2010 and windows SDK 7.0a compilation error</a></p>
  
  <pre><code>1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5472): error C2061: syntax error : identifier 'BSTR'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5497): error C2061: syntax error : identifier 'BSTR'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5507): error C2061: syntax error : identifier 'BSTR'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5525): error C2061: syntax error : identifier 'BSTR'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5544): error C2061: syntax error : identifier 'BSTR'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5569): error C2061: syntax error : identifier 'BSTR'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5579): error C2061: syntax error : identifier 'BSTR'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(303): error C2146: syntax error : missing ';' before identifier '_pchBuf'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(303): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(303): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(306): error C2146: syntax error : missing ';' before identifier '_pszFound'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(306): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(306): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(307): error C2146: syntax error : missing ';' before identifier '_pszExpected'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(307): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(307): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(410): error C2061: syntax error : identifier 'BSTR'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(535): error C2061: syntax error : identifier 'BSTR'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(596): error C2061: syntax error : identifier 'BSTR'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(599): error C2061: syntax error : identifier 'BSTR'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(602): error C2061: syntax error : identifier 'BSTR'
  </code></pre>
  
  <p>For Jonathan's question, the include part in the main cpp is as the following:</p>
  
  <pre><code>// Defines the entry point for the console application.
  //
  #include "stdafx.h"
  #define _CRTDBG_MAP_ALLOC 
  #include &lt;stdlib.h&gt;
  #include &lt;crtdbg.h&gt;
  
  #include &lt;math.h&gt;
  //----------------------------------------------------------------------------------
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  #include &lt;afx.h&gt;
  #include &lt;time.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;map&gt;
  #include &lt;direct.h&gt;
  // insert specific include here
  #include "recordSet.h"
  #define  roundX(x)  ( floor(100.0 * x + 0.49 )) / 100  ;
  #include "OutputAccumulator.h"
  using namespace std;
  </code></pre>
  
  <p>Here is the code of stdfax.h:</p>
  
  <pre><code>#pragma warning(disable : 4786) 
  
  #if !defined(AFX_STDAFX_H__25F9CFE5_5C52_11D5_98E7_000255667102__INCLUDED_)
  #define AFX_STDAFX_H__25F9CFE5_5C52_11D5_98E7_000255667102__INCLUDED_
  
  #if _MSC_VER &gt; 1000
  #pragma once
  #endif // _MSC_VER &gt; 1000
  
  #define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers
  
  #include &lt;afx.h&gt;
  #include &lt;afxwin.h&gt;         // MFC core and standard components
  #include &lt;afxext.h&gt;         // MFC extensions
  #include &lt;afxdao.h&gt;         // MFC DAO database classes
  #include &lt;afxdtctl.h&gt;       // MFC support for Internet Explorer 4 Common Controls
  #ifndef _AFX_NO_AFXCMN_SUPPORT
  #include &lt;afxcmn.h&gt;         // MFC support for Windows Common Controls
  #endif // _AFX_NO_AFXCMN_SUPPORT
  
  #include &lt;iostream&gt;
  
  
  #define     VERY_SMALL_VALUE    0.0000001
  
  // TODO: reference additional headers your program requires here
  
  //{{AFX_INSERT_LOCATION}}
  // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  
  #endif // !defined(AFX_STDAFX_H__25F9CFE5_5C52_11D5_98E7_000255667102__INCLUDED_)
  </code></pre>
  
  <p>Thanks for any insight!</p>