什么是“多线程调试DLL”运行时库选项在VS 2008中执行? [英] What exactly is the "Multi-threaded Debug DLL" Runtime Library option doing in VS 2008?

查看:182
本文介绍了什么是“多线程调试DLL”运行时库选项在VS 2008中执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS 2008中有一个创建DLL的解决方案。然后我在另一个应用程序中使用该DLL。如果我进入DLL项目属性页面,并更改以下DEBUG构建的配置,那么内置的dll不会提供所需的功能。如果我更改它并重建DLL,那么DLL确实提供了正确的功能:



属性页=>配置属性=> C / C ++ =>代码生成=>运行库



如果设置为 多线程调试DLL(/ MDd) / b>
那么一切都应该是正常的。我从DLL获取正确的功能



如果设置为 多线程DLL(/ MD) 那么DLL无法正常运行...没有运行时错误或任何东西,它只是不起作用(DLL应该在地图上绘制一些线,但不在此模式)。


所以问题是,为什么使用/ MDd标志会导致底层代码的修正功能,而/ MD会导致不正确的功能?



有一点背景...有人在C ++中开发了DLL,我在VB.net应用程序中使用这个DLL。

解决方案

所有DLL /调试代码生成必须匹配使用它们的所有内容。可能有另一个引用的库或对象或DLL或者使用错误选项构建的一些代码;或覆盖全局项目选项的单个元素的特定选项。



唯一的方法是仔细检查每个文件的所有选项,检查包含和引用的库(.lib和.dll)和对象文件。检查链接器选项。



它不起作用的原因可能是因为调试版本在内存周围添加了额外的保护块,以允许检测到错误。 >

I have a solution in VS 2008 that creates a DLL. I then use that DLL in another application. If I go in to the DLL projects property pages and change the following configuration for a DEBUG build then the built dll no long provides the desired functionality. If I change it back and rebuild the DLL, then the DLL does provide the correct functionality:

Property Pages => Configuration Properties => C/C++ => Code Generation => Runtime Library

If set to "Multi-threaded Debug DLL (/MDd)" then everything works as it should. I get the correct functionality from the DLL

If set to "Multi-threaded DLL (/MD)" then the DLL does not function properly...no runtime errors or anything, it just doesn't work (The DLL is supposed to plot some lines on a map but does not in this mode).

So the question is, why does using the /MDd flag result in correction functionality of the underlying code, while /MD results in incorrect functionality?

A little background...somebody else developed the DLL in C++ and I am using this DLL in a VB.net application.

解决方案

All DLL's/debug code generation must match across everything that uses them. There may be another referenced library or object or dll or some code in there that is built using the wrong options; or specific options for an individual element that override the global project options.

The only way of figuring it out is to meticulously check all of the options for each file, checking the included and referenced libraries (.lib and .dll) and object files. Check the linker options too.

The reason why it doesn't work is probably because the debug version adds extra guard blocks around memory to allow detection of errors.

这篇关于什么是“多线程调试DLL”运行时库选项在VS 2008中执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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