C ++ Unmanaged& C ++托管链接(.NET 3.5及更低版本)[VS2015]

C ++ Unmanaged& C ++托管链接(.NET 3.5及更低版本)[VS2015]

问题描述:

您好,

我目前正在尝试将非托管静态库(C ++)链接到具有.NET 3.5(或更低版本)的托管DLL(C ++)。 br />
将它链接到4.0及更高版本工作正常,但不幸的是我不能高于3.5(SQL-Server 2008)。

I'm currently trying to link a unmanaged static library (C++) to a managed DLL (C++) having .NET 3.5 (or lower).
Linking it to a 4.0 and higher works fine, though unfortunately I cannot go any higher than 3.5 (SQL-Server 2008).

试图链接它,弹出几个错误。我试图通过Google在*和此处进行研究,遗憾的是到目前为止还没有成功。

Trying to link it, a couple of errors pop up. I've tried to research this via Google on * and on here, sadly without success so far.

问题是这些链接器错误,关于不一致的属性(不使用类的任何属性) ):

The problems are these linker errors, something about inconsistent attributes (not using any attributes on classes):

1>  Finished generating code
1>MSVCMRTD.lib(mstartup.obj) : error LNK2022: metadata operation failed (80131195) : Die benutzerdefinierten Attribute sind nicht konsistent: (0x0c0001ec).
1>MSVCMRTD.lib(mstartup.obj) : error LNK2022: metadata operation failed (80131195) : Die benutzerdefinierten Attribute sind nicht konsistent: (0x0c0001f0).
1>MSVCMRTD.lib(managdeh.obj) : error LNK2022: metadata operation failed (80131195) : Die benutzerdefinierten Attribute sind nicht konsistent: (0x0c0000ce).
1>MSVCMRTD.lib(managdeh.obj) : error LNK2022: metadata operation failed (80131195) : Die benutzerdefinierten Attribute sind nicht konsistent: (0x0c0000d2).
1>MSVCMRTD.lib(mehvecdtr.obj) : error LNK2022: metadata operation failed (80131195) : Die benutzerdefinierten Attribute sind nicht konsistent: (0x0c0000a5).
1>MSVCMRTD.lib(mehvecdtr.obj) : error LNK2022: metadata operation failed (80131195) : Die benutzerdefinierten Attribute sind nicht konsistent: (0x0c0000a9).
1>MSVCMRTD.lib(msilexit.obj) : error LNK2022: metadata operation failed (80131195) : Die benutzerdefinierten Attribute sind nicht konsistent: (0x0c0000f8).
1>MSVCMRTD.lib(msilexit.obj) : error LNK2022: metadata operation failed (80131195) : Die benutzerdefinierten Attribute sind nicht konsistent: (0x0c0000fb).
1>MSVCMRTD.lib(pureMSILcode.obj) : error LNK2022: metadata operation failed (80131195) : Die benutzerdefinierten Attribute sind nicht konsistent: (0x0c0001aa).
1>MSVCMRTD.lib(pureMSILcode.obj) : error LNK2022: metadata operation failed (80131195) : Die benutzerdefinierten Attribute sind nicht konsistent: (0x0c0001ad).
1>LINK : fatal error LNK1255: link failed because of metadata errors

这有什么好的/简单的解决方案吗?

Is there any good / simple solution to this ?

您好Blacktempel,

Hi Blacktempel,

此论坛讨论和询问有关.NET Framework基类的问题,由于您的问题与VC ++有关,我将把线程移到VC ++论坛以获得合适的支持。

This forum discusses and asks questions about .NET Framework Base Classes, Since your issue is more related to VC++, I'll move the thread to VC++ forum for suitable support.

感谢您的理解。

祝你好运,

Cole Wu