Ignoring files when merging metadata during build process in VS2005
I am trying to compile my project with a common language version and I suddenly run into the following linking errors when I try to do a debug build:
Main.obj : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (IDirect3DVertexShader9): (0x0200056e).
Main.obj : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (IDirect3DVertexDeclaration9): (0x0200056f).
Main.obj : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (IDirect3DDevice9): (0x02000a2a).
Main.obj : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (IDirect3DSwapChain9): (0x02000ab0).
Main.obj : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (IDirect3DIndexBuffer9): (0x02000ace).
Main.obj : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (IDirect3DVertexBuffer9): (0x02000b4e).
Main.obj : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (IDirect3DTexture9): (0x02000bbd).
Main.obj : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (IDirect3D9): (0x02000c0e).
LINK : fatal error LNK1255: link failed because of metadata errors
I tried to restore the whole solution and I still see the same error. If anyone knows what might be causing this, I would like to know. The only solution I can see is to tell the debugger not to generate debug information for duplicate types. The only problem is I don't know how to do it (or even if it is possible). If anyone knows, I would be grateful for your help.
Thank you very much for your help!
Daniel Auerbach
Do you have multiple versions IDirect3D
or any other library? For example: let's say you have several modules, a dll that you previously created (with an unknown version dependency IDirect
) and a module that you created with the latest version of that library. This can lead to this error.
See MSDN documentation for LNK 2022
a source to share
I got this error if you are redirecting class classes in C ++ / CLI and then reading the full declaration somewhere else:
// one.h
class CMyNewClass;
// two.h
class CMyNewClass
{
//...
};
//main.cpp
#include "one.h"
#include "two.h"
//...
I think this combination is causing this problem, but I don't have Visual Studio right now to double check it.
a source to share