标签:
问题产生的过程是这样的,向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。
标签:
原文地址:http://www.cnblogs.com/gisair/p/4441517.html