Including .pdb files with librarian in Visual Studio

送分小仙女□ 提交于 2019-12-22 04:29:31

问题


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?


回答1:


The static library has probably been moved, so the compiler can't find the symbols from it. You have several options:

  • change debugging format to /Z7, which embeds the debug info in the code (whereas /Zi and /ZI put it in a separate file).
  • change the output configuration of the pdb file (for VS2005 it was Settings > C++ > Output Files > Program Database File Name, probably similar in VS2010).

You can find more information here and here.




回答2:


Go to Property Pages (Alt+F7) Linker, All options, Generate Debug Info set into No Position



来源:https://stackoverflow.com/questions/14268019/including-pdb-files-with-librarian-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!