10

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).

Community
  • 1
  • 1
PolGraphic
  • 3,233
  • 11
  • 51
  • 108

1 Answers1

16

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

Mike Vine
  • 9,468
  • 25
  • 44
  • That's IT! For some reason, `Generate Debug Information` was an empty value (neither `YES` or `NO`). I don't remember to mess with `Linker`. But I **did** created a project with some custom Wizard (both `Debug` and `Release` build targets was created). Thank you, sir - it was agonizing me for hours before I've posted the question :) – PolGraphic Dec 15 '14 at 12:05