I have a test executable linking a C++ static library in Visual Studio 2019 (16.4.2) on Windows 10. When I launch the debugger, all breakpoints in test cilent and library code appear hollowed-out with a tooltip that the PDB could not be located:
"The breakpoint will not currently be hit. No symbols have been loaded for this document."
After launching the debugger, manually browsing for the executable PDB from the link on the "No Symbols Loaded" screen also fails with the message:
"A matching symbol file could not be found in this folder"
This odd as the file is there, it is up-to-date, and the PDB browser lets me select it. It is the correct PDB (specified in Linker > Debugging settings), not the much smaller intermediate-folder one.
I am building Debug|x86 and get the same issue in Debug|x64. My test executable is using Google Test version 1.8.1.2.
I have tried deleting all intermediate files and output, closed/reopened the IDE and rebuilt the solution, but this hasn't helped. The PDB is not being overwritten by an identically-named one from some other project.
The project settings I have are as follows:
Test executable AND static library:
C/C++ > General: Debug Information Format = Program Database (/Zi).
Test executable:
Linker > Debugging: Generate Debug Info = Generate Debug Information (/DEBUG)
Linker > Debugging: Generate Program Database File = $(OutDir)$(TargetName).pdb
The 3rd party Google test PDBs are present in the output folder, copied by the build from the NuGet package I am using. I have checked these are the correct PDBs. I don't think I need these anyway as I'm not trying to debug into any Google test code.
I have tried creating a new "Hello world" test executable and can debug into that without any problem.