I have a project whose output is a library (.lib). The project depends on a third party library (also a .lib). In order to avoid projects built on top of my library having to worry about this third party dependency, I have used the librarian to include it in mine (Project Properties > Librarian > General > Additional Dependencies).
However, when I build a separate executable project which links to my library, I get a bunch of warnings along the lines of:
MyProject.lib(someThirdPartyObjectFile.obj) : warning LNK4099: PDB 'vc110.pdb' was not found with 'MyProject.lib(someThirdPartyObjectFile.obj)' or at '\vc110.pdb'; linking object as if no debug info
This means (I assume) that I will be able to debug any code belonging to my library, but not to the third party library.
How can I instruct Visual Studio to also include the contents of the third party library's PDB in mine?
Visual Studio expects to see a PDB file in the same folder as the DLL or EXE file. You can view and edit Protein Data Bank files in Windows, Linux, and macOS with Avogadro. These programs can open the file, too: Jmol, RasMol, QuickPDB, and USCF Chimera.
PDB files should be placed in a single folder and you need to point Visual Studio to that folder so that it gets PDB files from it. But, if you don't want Visual Studio to ask you about the location of source code files, you need to move our source code to a folder structure as on our build server.
A program database file (extension . pdb) is a binary file that contains type and symbolic debugging information gathered over the course of compiling and linking the project. A PDB file is created when you compile a C/C++ program with /ZI or /Zi or a Visual Basic, Visual C#, or JScript program with the /debug option.
The static library has probably been moved, so the compiler can't find the symbols from it. You have several options:
/Z7
, which embeds the debug info in the code (whereas /Zi
and /ZI
put it in a separate file).Settings > C++ > Output Files > Program Database File Name
, probably similar in VS2010).You can find more information here and here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With