debugging information cannot be found or does not match visual studio's

Viewed 61934

I copied an existing project and renamed the folder. Now I get this error when I try to compile the application

debugging information cannot be found or does not match. No symbols loaded.
Do you want to continue debugging ?

If I click yes, it compiles and runs fine. But now I have to deal with that message. Just curious about what I change in the projects properties to get it to stop.

14 Answers

You probably have deactivated the debugging information for your project:

  • Right click on your project -> Properties
  • Configuration properties -> Linker -> Debugging
  • Switch "Generate Debug Info" from No to Yes

Rebuild your project and retry, it should now run without the message :)

The main reason is that you don't have a matching pdb and exe.

Some possible solutions:

  • You are compiling in release instead of debug
  • You need to clean/build or rebuild
  • You don't have your pdb files being generated in the same directory as the exe
  • You have a mismatching pdb, maybe the copied source is newer than today's date and something isn't building properly.
  • Try cleaning out all debug object files
  • You are attaching to a process that you started from a different location from where your build exe and pdb exist
  • Restart Visual Studio

Enable PDB creation by:

Right click on MyProject > Properties > Debugging:

  • C/C++ > General > Debug Information Output = Program Database (/Zi)
  • Linker > Debugging > Generate Debug Info = Yes (/DEBUG)

Clean MyProject, restart Visual Studio (just to be sure), rebuild MyProject. The output folder should then contain *.pdb files.

If you debug optimized/release code consider switching off optimization via

  • C++ > Optimization > Optmization = Disabled (/Od)

The pdb or Program Database file appears to be missing (basically, the path has changed and can no longer be found by the compiler). See this related post for additional information.

Related