在Visual Studio中包含.pdb文件与库管理器 [英] Including .pdb files with librarian in Visual Studio

查看:698
本文介绍了在Visual Studio中包含.pdb文件与库管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,其输出是一个库(.lib)。该项目取决于第三方库(也是.lib)。为了避免在我的图书馆之上建立的项目不得不担心这个第三方依赖,我已经使用图书管理员将其包含在我的(项目属性>图书馆员>常规>附加依赖关系)中。



然而,当我建立一个链接到我的图书馆的单独的可执行项目时,我会发现以下一行警告:


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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆