<p>I am getting C++ Compiler error C2371 when I include a header file that itself includes odbcss.h. My project is set to MBCS.</p>

<blockquote>
  <p>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\odbcss.h(430) :
  error C2371: 'WCHAR' : redefinition; different basic types 1><br>
  C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winnt.h(289) :
  see declaration of 'WCHAR'</p>
</blockquote>

<p>I don't see any defines in odbcss.h that I could set to avoid this. Has anyone else seen this? </p>

[{'answer_id': 42138, 'author': 'Craig H', 'author_id': 2328, 'author_profile': 'https://Stackoverflow.com/users/2328', 'pm_score': 0, 'selected': False, 'text': '<p>This error happens when you redeclare a variable of the same name as a variable that has already been declared.  Have you looked to see if odbcss.h has declared a variable you already have?</p>\n'}, {'answer_id': 42207, 'author': 'John Boker', 'author_id': 2847, 'author_profile': 'https://Stackoverflow.com/users/2847', 'pm_score': 0, 'selected': False, 'text': '<p>does this help?</p>\n\n<p><a href="http://bytes.com/forum/thread602063.html" rel="nofollow noreferrer">http://bytes.com/forum/thread602063.html</a></p>\n\n<p>Content from the thread:</p>\n\n<blockquote>\n  <p>Bruno van Dooren [MVP VC++] but i know the solution of this problem.\n  it solves by changing project setting of "Treat wchar_t as Built-in\n  Type" value "No (/Zc:wchar_t-)". But I am using "Xtreme Toolkit\n  Professional Edition" for making good look &amp; Feel of an application,\n  when i fix the above problem by changing project settings a new\n  linking errors come from Xtreme Toolkit Library. So what i do to fix\n  this problem, in project setting "Treat wchar_t as Built-in Type"\n  value "yes" and i wrote following statements where i included wab.h\n  header file. You can change that setting on a per-codefile basis so\n  that only specific files are compiled with that particular setting. If\n  you can solve your problems that way it would be the cleanest\n  solution.</p>\n  \n  <p><code>#define WIN16</code></p>\n  \n  <p><code>#include "wab.h"</code></p>\n  \n  <p><code>#undef WIN16</code></p>\n  \n  <p>and after that my project is working fine and all the things related to WAB is also working fine. any one guide me, is that the right way\n  to solve this problem??? and, will this have any effect on the rest of\n  project?? I wouldn\'t worry about it. whatever the definition, it is a\n  16 bit variable in both cases. I agree that it isn\'t the best looking\n  solution, but it should work IF WIN16 has no other impact inside the\n  wab.h file.</p>\n  \n  <p>--</p>\n  \n  <p>Kind regards, Bruno van Dooren bruno_nos_pam_van_dooren@hotmail.com\n  Remove only "_nos_pam"</p>\n</blockquote>\n'}, {'answer_id': 42318, 'author': 'Brian Stewart', 'author_id': 3114, 'author_profile': 'https://Stackoverflow.com/users/3114', 'pm_score': 1, 'selected': False, 'text': "<p>There are a half-dozen posts on various forums around the web about this - it seems to potentially be an issue when odbcss.h is used in the presence of MFC. Most of the answers involve changing the order of included headers (voodoo debugging). The header that includes odbcss.h compiles fine in it's native project, but when it is included in a different project, it gives this error. We even put it in the latter project's stdafx.h, right after the base include for MFC, and still no joy. We finally worked around it by moving it into a cpp file in the original project, which does not use MFC (which should have been done anyway - but it wasn't our code). So we've got a work-around, but no real solution.</p>\n"}, {'answer_id': 42327, 'author': 'ChrisN', 'author_id': 3853, 'author_profile': 'https://Stackoverflow.com/users/3853', 'pm_score': 3, 'selected': True, 'text': '<p>This is a known bug - see the Microsoft Connect website:</p>\n\n<p><a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98699" rel="nofollow noreferrer">http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98699</a></p>\n\n<p>The error doesn\'t occur if you compile your app as Unicode instead of MBCS.</p>\n'}]
['https://Stackoverflow.com/questions/42126', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3114/']