What this message means "LNK2022: metadata operation failed" ?

G

Guest

MC++ application, I've got "LNK2022 error message...

MyApp error LNK2022: metadata operation failed (8013118D) : Inconsistent method declarations in duplicated types(CMainFramel). (0x02000008).

It seems to be some my struct type have a "#pragma pack (push, 1)".
Delete that #pragma keywords. Solve the LNK2022 problem.
But why? That "#pragma ..." line make the problem and what's the meaning of two value (8013118D, 0x02000008).
It seem to be varibale for appliation and code... What's is this meaning for??
 
G

Gary Chang

Hi,
what's the meaning of two value (8013118D, 0x02000008).

metadata operation failed (HRESULT) : error_message
The 8013118D is the HRESULT, the 0x02000008 is the RVA of the type in the
error message.


"According to the MSDN,one reason for LNK2022 is when a struct exists in
multiple modules with the same name, but with conflicting definitions, and
when you compile with /clr.

This usually happens because somehow the compiler puts slightly different
metadata in two modules for the same type. At link time, when the metadata
is merged, this error is emitted because the name for the type is the same,
but there is some descrepancy in the rest of the metadata describing that
type."

In your scenarion, it appears the problematic type has the conflict
alignment.


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
R

Ronald Laeremans [MSFT]

0x02000008 is the RVA of the type in the error message.

More specifically, it is the token ID of the metadata token referring to the
definition. You can use ildasm to see what type it rfers to.

Ronald Laeremans
Visual C++ team
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top