解決VS2010 C++ DLL不能斷點調試的問題

來源:互聯網
上載者:User

標籤:

問題產生的過程是這樣的,向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不能斷點調試的問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.