在Visual Studio中包含.pdb文件与库管理器 [英] Including .pdb files with librarian in Visual Studio
问题描述
然而,当我建立一个链接到我的图书馆的单独的可执行项目时,我会发现以下一行警告:
MyProject.lib(someThirdPartyObjectFile.obj):警告LNK4099:未找到MyProject.lib(someThirdPartyObjectFile.obj)或\vc110.pdb的PDB'vc110.pdb';链接对象,如果没有调试信息
这意味着(我假设)我将能够调试属于我的库的任何代码,但不是第三方图书馆。
如何指示Visual Studio在我的第三方图书馆的PDB的内容?
静态库已经被移动了,所以编译器找不到符号。您有几个选项:
- 将调试格式更改为
/ Z7
,将调试信息嵌入到代码中(而/ Zi
和< a href =http://msdn.microsoft.com/en-us/library/958x11bc%28v=vs.100%29.aspx>/ ZI
将其放在一个单独的文件中) - 更改pdb文件的输出配置(对于VS2005,它是
设置> C ++>输出文件>程序数据库文件名
,可能在VS2010中类似)
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?
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.
这篇关于在Visual Studio中包含.pdb文件与库管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!