error C2371: 'WCHAR' : redefinition; different basic types

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi all, I've been haunted by this problem for quite a while. I've done
a lot of search on the internet but haven't found any solution to
this. I'm building an MFC program with ODBC support and got the
following error:

c:\program files\microsoft visual studio 8\vc\platformsdk\include
\odbcss.h(430) : error C2371: 'WCHAR' : redefinition; different basic
types
c:\program files\microsoft visual studio 8\vc\platformsdk
\include\winnt.h(266) : see declaration of 'WCHAR'

In odbcss.h I found

#ifdef UNICODE
....
#else
typedef char DBCHAR;
#endif

In ocdb.h I found

#if !defined(OLE2ANSI)

#define LPDBSTR LPWSTR
#define DBCHAR WCHAR
....

And in winnt.h I found

#ifndef _MAC
typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
....

Which seems to be a bug to me. I've seen this issue being raised many
times during my search but none of them is fully answered. Is there a
suggested solution to this at all?

.



Relevant Pages

  • STL bug in VS.NET 2002
    ... I use Visual Studio .NET 2002 right now, and I discovered a bug last night ... that I have found few references to on the internet. ... I tried this on .NET 2003 at work, and this bug has been fixed. ...
    (comp.lang.cpp)
  • Re: IntelliNonsense - Find all references
    ... browser problem is too involved to include in a service pask. ... This bug is a deal breaker with us, ... So now we go back to Visual Studio 6.0 yet again. ... The public bug reporting website at ...
    (microsoft.public.vc.ide_general)
  • Re: TabControl page order
    ... Thanks for the code Chris but that didn't seem to help. ... This doesn't look like a Compact Framework bug. ... When I look at the generated code I can see that Visual Studio is ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Quirk with RadioButtons when Application.ThreadException is being used to handle Unexpected Exce
    ... at which point the handler is no longer called. ... unhandled exception handlers behaved erratically when the porgram was run ... Try to run your program outside Visual Studio (that is: ... This seems to me to be more like a Visual Studio bug ...
    (microsoft.public.dotnet.general)
  • Re: Extermely nasty bug with the way .NET handles references
    ... that might be symptoms of the same bug. ... the forms) and then restart Visual Studio. ... > Unfortunately due to the annoying way .NET handles file locking you ...
    (microsoft.public.dotnet.languages.csharp)