I'm trying to add precompiled headers to a project that I'm working on.The non-debug version works fine, but I'm having trouble with the debug version. The code compiles and links fine and places the same pdb files in the same location as before I added precompiled headers. The pdb files are a bit smaller, but I think that is to be expected.
When I try to debug the version without precompiled headers, the debugger shows "Symbols loaded." When I try to debug the version with precompiled headers, I get "Cannot find or open the PDB file"
Identical code, except that there are include files in the precompiled header, no errors on the build, executables and pdb files in the same locations.
I'm not sure what else to check. Any suggestions would be appreciated. Thanks.
Visual Studio 2019, windows 10.
Update: The system we have here has two directories. A target directory and a distribution directory. The binaries are build into the target directory and symbolic links are set for the binaries in the distribution directory pointing to the actual binaries in the target directory.
Debug builds prior to my addition of precompiled headers produced different pdbs for each cpp file which were then copied to the target directory. The linker then used these pdbs from the target directory to produce its pdb in the target directory. The executables were run from the distribution directory and the debugger would find the pdb files which existed only in the target directory. No symbolic links needed.
After my changes, the compiler produces the same pdb file for all of the cpp files. These are produced directly in the target directory. The linker would use this pdb file and produce its pdb file, also in the target directory. The executable is run from the distribution directory with a symbolic link to the target directory. The debugger can not find the pdb files.
However... if I copy the pdb files from the target directory to the distribution directory, the debugger can now find the pdb files.
I don't see why one case works and the other doesn't. The linker is doing the same thing. The executable and the pdb files exist in the same place. The same symbolic links exist.
Another update: The problem turns out to not be related to precompiled headers. IT set up a new build server. The path in the executable for the pdb files is wrong. The path don't resolve to anything. Now the question is, "how does the linker determine what the path should be?". Its not the path to the target directory. Its not the path to any of the directories used in the build. Its not specified on the command line.