Click here to Skip to main content
15,885,818 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am modifying the MFC project odl file for adding new interface ILayer but it is already exists in other project so when I build all the projects I am getting the redefinition related error. as below:

f:\clearcase\compomap_source\compomap_cvob\source\vs2010\comworkspace\workspacetest\stdafx.h(68): warning C4278: 'min': identifier in type library '..\..\Debug\ComMapServer.exe' is already a macro; use the 'rename' qualifier
4>f:\clearcase\compomap_source\compomap_cvob\source\vs2010\comworkspace\workspacetest\stdafx.h(68): warning C4278: 'max': identifier in type library '..\..\Debug\ComMapServer.exe' is already a macro; use the 'rename' qualifier
5>  Processing C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\msxml.idl
5>  msxml.idl
5>  Processing ..\ComWorkspace\ComWorkspace.idl
5>  ComWorkspace.idl
5>  Processing ..\ComMapWorks\ComMapServer\ComMapServer.idl
5>  ComMapServer.idl
5>.\CompoMap.odl(1329): error MIDL2003: redefinition : ILayer
5>.\CompoMap.odl(1521): error MIDL2003: redefinition : IItem
5>.\CompoMap.odl(2328): warning MIDL2214: semantic check incomplete due to previous errors
6>------ Build started: Project: compotest, Configuration: Debug Win32 ------
Posted
Updated 24-Dec-10 0:22am
v3
Comments
Tony Richards 24-Dec-10 6:23am    
Fixed HTML encoding of angle brackets and apostrophe.

1 solution

You have pretty much answered your own question. Why are you redifining ILayer if it already exists elsewhere. Either define it under a unique name, or use the existing one.
 
Share this answer
 
Comments
jamshed11 26-Dec-10 22:59pm    
Thanks a lot for your reply. I am a new bee, here my requirement is to define new interface ILayer in project B with same name but different uuid and IID, also the member functions would be different hence I want to redefine the new interface with same name but different uuid and IID, but not able fix it till now. I am getting the same redefination error. I read somewhere in forum about using namespaces to access interfaces with same name. but in IDL file I dont know how to import or use namespace if one want to use namespace in .IDL file. It would be great if you know how to use namspace in .IDL file.
There is same question posted on code project with title "Duplicate Interface Names Across different components" please see that question too for more clearity about my question.

Thanks in Advance
Dnyanesh

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900