C++ 調試 The breakpoint will not currently be hit. No symbols have been loaded for this document.

C++ debug調試 :The breakpoint will not currently be hit. No symbols have been loaded for this document.

1. 編譯

以Test爲例,右鍵Properties,選擇Configuration Properties下General,設置output directory爲exe輸出的位置(如D:\test\debug),intermediate directory爲中間文件輸出位置(如D:\test\debug)。填寫要生成的可執行文件的名稱和後綴到Target Name和Target Extension,本文爲Test.exe。
properties-general圖

2. debug

右鍵Properties,選擇Configuration Properties下Debugging。
在這裏插入圖片描述
設置要debug的command,如D:\test\debug\Test.exe。命令選項(可選,如–test)。命令執行的位置,如D:\test\debug\。
點擊Debug-Start Debugging即可進行調試。

3. 問題

無法進入斷點:The breakpoint will not currently be hit. No symbols have been loaded for this document.
執行Start without Debugging,程序正常運行。執行Start Debugging程序退出,而不進入斷點。c#根據pdb文件進行調試,檢查是否生成xxx.pdb文件。如沒生成,右鍵Properties,選擇Configuration Properties - Linker - Debugging,將Generate Debug Info 從No改爲Generate Debug Info。
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章