PDB文件与Visual Studio 10中的库

PDB文件与Visual Studio 10中的库

问题描述:

在MS Visual Studio 10中使用调试信息构建静态库( .LIB )时,
.PDB 总是命名为 vc100.pdb
(与构建 .DLL ,其中调试信息是 [MyProjectName] .pdb

When building a static library (.LIB) in MS Visual Studio 10 with debug information, the .PDB is always named vc100.pdb.
(as opposed to building a .DLL, where the debug info is [MyProjectName].pdb)

我试图复制几个不同的库(和他们的调试符号)到PublishedLibraries的目录,但所有 vc100.pdb $ c>名称明显相冲突。

This is a problem for me because I'm trying to copy several different libraries (and their debug symbols) to a directory of "PublishedLibraries", but all the vc100.pdb names obviously collide.

我确定我可以更改每个 .PDB 匹配 .LIB ,但对我来说更大的问题是为什么 Visual Studio认为 vc100.pdb 是比 projectA.pdb ??
更好的名称
如果所有名称冲突,我们如何使用来自多个库的Debug Info?

I'm sure I can change the names of each .PDB to match its .LIB, but for me the bigger question is why does Visual Studio think vc100.pdb is a better name than projectA.pdb??
How are we intended to work with Debug Info from multiple libraries if all the names conflict?

如果你使用/ Z7(而不是/ ZI或/ Zi) > Debug Information Format],那么调试信息嵌入在lib文件本身,而不是单独的pdb,这意味着你不需要担心相同的名称。

If you use /Z7 (instead of /ZI or /Zi) [ in the UI C/C++ -> General -> Debug Information Format] then the debug information is embedded in the lib file itself, instead of a separate pdb, which means you don't need to worry about the same name.

当你编译最终的可执行文件(.exe或.dll)时,你会从所有的小的嵌入的pdbs中得到一个合并的pdb。

When you build your final executable (.exe or .dll) then you'll get a merged pdb from all the little embedded pdbs.

http://*.com/questions/7575298/static-library-debug-symbols\">此问题了解详情

see this question for more info

它的方式我总是在我的团队管理这个问题,因为你不能在构建过程中丢失调试信息。它膨胀了libs有点[但总的比同时有lib和pdb],但因为你可能不装船,你不应该担心这么多。

Its the way I've always managed this issue on my team, as you can't lose the debug information during the build process. It bloats the libs somewhat [but no more in total than having both lib and pdb], but as you probably don't ship libs you shouldn't worry to much about this.