PolGraphic PolGraphic - 1 month ago 17
C++ Question

"The breakpoint will not currently be hit" - and I cannot add the .pdb file

I have a solution with one project in Visual Studio 2013 (Visual C++).

But when I build it in

debug
mode, then run it in
debug
mode I get:


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


I was trying to fix it in analogical way to what people suggested for Visual C# Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document."

Unfortunately, none of that worked:


  • clean & rebuild solution (also with manually deleted temporary files),

  • solution -> Properties -> Startup Project -> startup projects -> Start action
    ,

  • Debug/General settings
    -> uncheck
    Just My Code
    ,

  • quit VC++, reload, restart PC.



Then I've tried to select the
.pdb
file (after
clear, rebuild
) with
Debug -> Windows -> Modules
and
RMB -> Load symbols
.
v120.pdb
was in
/Solution/Debug
folder and
.exe
was in
/Bin
folder. I've chosen it and I got an error message:


A matching symbol file was not found in this folder.


What else can I do? Which solution/project options may have affected debugging? I build an
x86 .exe
project that include some of my
.lib
files (but the debugging doesn't work even in
main.cpp
).




Additional information (some were requested by users in comments):



I see that under
Debug -> Windows -> Modules
there is such entry for my
.exe
:


Project.exe F:...exe N/A N/A Binary was not built with debug information. 1 12/15/2014 12:31 PM 00BA0000-00E9C000 [3504] Project.exe


That's quite strange because the
Solution/Debug
folder is being created each time I hit
Rebuild
for
Debug
mode, and so I get new
.pdb
file also. I am running the application with
Debug
mode selected.




The value of
Project -> Properties -> C/C++ -> General -> Debug Information Format
is
Program Database for Edit And Continue (/ZI)
.

Answer

It looks like you're not properly generating debug information which is what the modules window is telling you. Make sure that the following properties are both set up:

Project -> Properties -> C/C++ -> General -> Debug Information Format

and

Project -> Properties -> Linker -> Debugging -> Generate Debug Information.

These can sometimes get change accidentally.

I've never seen this information get lost without a good cause though unless you've got a custom build solution