Error message when you compile an ATL attributed project in Visual C++ .NET: "MIDL2003 : redefinition" (325134)
The information in this article applies to:
- Microsoft Visual C++ .NET (2002)
This article was previously published under Q325134 SYMPTOMS When you compile an ATL based attributed project in Visual
C++ .NET, you may receive the following error message from MIDL compiler:
error MIDL2003 : redefinition : IMyInterface
CAUSE This behavior occurs under the following conditions:
- Your project uses attributes.
-and- - Your project does not use /ZI (Program Database
for Edit&Continue),
to build debug information. (Therefore, in release builds, this problem can
occur easily.)
-and- - You use #include to include a header file, which can result in entries being added
to the project's IDL file two or more times (in different source files) if
either the case or the path is different in the name of each of the header file
entries that is added to the different source files.
When all of these conditions exist, the compiler treats each
instance of the header file that you used #include to include as a different file, and then adds the duplicate
entries to the compile-time generated IDL file, which causes the error.
RESOLUTION To avoid this behavior, use the same case and the same path
for each instance of the header file in each source file when you use #include to include the header, so that #include is the same in every source file. STATUS This
bug was corrected in Microsoft Visual C++ .NET 2003.
REFERENCES For more information about attributes and ATL programming,
visit the following Microsoft Web sites:
Modification Type: | Minor | Last Reviewed: | 1/4/2006 |
---|
Keywords: | kbbug kbNativeAttributes kbpending KB325134 kbAudDeveloper |
---|
|