C++ Compiler Error C2371 – Redefinition of WCHAR

cvisual studio

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

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

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

Best Answer

This is a known bug - see the Microsoft Connect website:

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98699

The error doesn't occur if you compile your app as Unicode instead of MBCS.

Related Topic