Question

I use PDB files built with "Program Database for Edit And Continue (/ZI)" for Debug builds, which generates PDB files, as I want to be able to step into source of libraries I'm using in a project when debugging the project. When using DLLs with PDB files, according to MSDN, the compiler looks for the PDB files in the folder where the DLL (or EXE) files are. But I also have components that are static LIBs rather than shared. I usually set the compiler to generate PDB files named with the project, rather than the platform (the latter being the default) so I can move them around without filename conflicts. But where should I put these PDB files from the static LIBs? Do I put them in the same folder as the LIBs are? I keep my built LIBs in a different folder than the executables, as I have a folder hierarchy something like \bin \include \lib \data.

Was it helpful?

Solution

You should copy the PDBs to the same location as the LIBs they are associated with. When the linker is run to produce a DLL or EXE from the LIB, it will use the LIB PDB to produce the PDB for the DLL or EXE.

You can use Post-Build Event to add command-line operations to copy the LIBs/PDBs around after each build.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top