码迷,mamicode.com
首页 > 编程语言 > 详细

解决VS2010 C++ DLL不能断点调试的问题

时间:2015-04-20 16:33:02      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

问题产生的过程是这样的,向exe项目(CSharp)中添加dll工程(c++开发)的引用,并将引用工程的属性“Link Library Dependencies”的值设为true,这样,在不加入lib的情况下,exe项目仍可以链接dll正常运行,但问题也出现了,在dll工程中设置 的断点会被无视。

 

解决方法:

一、DLL工程的设置

设置Configuration Properties->General->Output Directory的值为$(SolutionDir)\bin\$(Configuration)\

设置Configuration Properties->Linker->Debugging的值为$(SolutionDir)lib\$(Configuration)\$(ProjectName).pdb

设置Configuration Properties->Linker->Advanced的值为$(SolutionDir)lib\$(Configuration)\$(ProjectName).lib

 

二、exe工程的设置(C++的设置方法,C#的不做这一步)

将引用工程的属性“Link Library Dependencies”的值设为fasle。

设置Configuration Properties->Linker->General->Additional Library Directories的值设置为$(SolutionDir)lib\$(Configuration)\

在Configuration Properties->Linker->Input->Additional Dependencies中加入xxx.lib

 

三、开启断点功能

1. managed code的项目属性中debug页里,"Enable unmanaged code debugging"选上。

2. unmanaged code项目属性的debugging页里,Debugger Type设为Mixed。

解决VS2010 C++ DLL不能断点调试的问题

标签:

原文地址:http://www.cnblogs.com/gisair/p/4441517.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!