You may receive an "error MIDL2003 : redefinition" error message if you install Visual Studio or Platform SDK to a path that uses MBCS or high ANSI characters (316550)



The information in this article applies to:

  • Microsoft Visual C++ .NET (2002)

This article was previously published under Q316550

SYMPTOMS

When you compile a default Active Template Library (ATL) COM project, if the following conditions exist:
  • Microsoft Visual Studio 7 files or the Platform SDK files are installed in a directory that contains high American National Standards Institute (ANSI) characters (greater than 127). -or -

  • Microsoft Visual Studio 7 files or the Platform SDK files are installed in a directory that uses multi-byte character set (MBCS) encodings (like those you see when the Windows locale is set to Chinese, Japanese, or Korean).
You may receive the following error message:
error MIDL2003 : redefinition

CAUSE

The Microsoft Interface Definition Language (MIDL) program file, Midl.exe, may change the case of MBCS or characters that have an ANSI code that is greater than 127 from uppercase to lowercase. In addition, Midl.exe may not recognize that the uppercase version of a character is the same character as the lowercase version of the character. This inability to distinguish between upper and lowercase versions of the same character causes Midl.exe to process the same file twice, and results in the error message mentioned earlier.

WORKAROUND

To work around this problem, remove Visual Studio, and then reinstall Visual Studio to a directory that does not contain these high ANSI characters.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Visual C++ .NET 2003.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Install Microsoft Visual Studio in a directory that contains high ANSI characters.
  2. Use the ATL Project Application Wizard to create a default ATL project. Attempt to compile the project.

Modification Type:MinorLast Reviewed:1/6/2006
Keywords:kbbug kbfix KB316550 kbAudDeveloper