VS 2012 Destructor装饰 [英] VS 2012 Destructor Decorations

查看:70
本文介绍了VS 2012 Destructor装饰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天在Visual Studio 2012中遇到了一个奇怪的功能。



症状是可执行文件无法在我们的DLL中找到导出的函数。在VS 2008中构建时,此代码可正常运行。



我终于确定了问题。调用可执行文件正在为类寻找虚拟析构函数,但类本身不包含虚拟析构函数。 dll和调用者之间的名称不匹配。



显然,解决方法很简单直接。但是需要时间才能找到我们的代码中显示的所有实例。



这是2012年的新要求,还是错误?

解决方案

Microsoft需要它。自己阅读:有点搞笑:请注意,这些规则对于不可移植的类是相同的。



http://msdn.microsoft.com/en-us/library/81h27t8c(v = VS.80)的.aspx [ ^

I came across an odd feature in Visual Studio 2012 today.

The symptom is that an executable was unable to find an exported function in one our DLLs. This code functions properly when built in VS 2008.

I finally determined the issue. The calling executable was looking for a virtual destructor for the class, but the class itself did not contain a virtual destructor. There is a mismatch in the name mangling between the dll and the caller.

Clearly the workaround is simple and straight forward. But it will take time to find all of the instances in our code where this manifests.

Is this a new requirement of 2012, or a bug?

解决方案

Microsoft requires it. Read it for yourself: a little funny: "Note that these rules are the same for nonexportable classes."

http://msdn.microsoft.com/en-us/library/81h27t8c(v=vs.80).aspx[^]


这篇关于VS 2012 Destructor装饰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆