从命令行抑制 PDB 生成 - C++ [英] Supressing PDB generation from the command line - C++
问题描述
我进行了一番搜索,可以找到一些使用 Visual Studio 菜单来禁止创建 PDB 文件的示例.我需要为我正在构建的项目执行此操作,但是,这仅需要从命令行使用 Visual Studio 编译器.是否有用于禁用 PDB 生成的命令行开关?
I've had a search around and can find a few examples of using Visual Studio menus to suppress creation of PDB files. I need to do this for a project I'm building, however, this requires using the Visual Studio compiler from the command line only. Is there a command line switch for disabling PDB generation?
推荐答案
当您在 Visual Studio 中浏览项目设置时,大多数选项会告诉您它们的等效命令行开关是什么.
When you navigate through project settings in Visual Studio, most options tell you what their equivalent command-line switch is.
要禁用链接时 PDB 生成,请省略 /DEBUG
开关.
To disable link-time PDB generation, omit the /DEBUG
switch.
要禁用编译时 PDB 生成,请省略 /Z
开关 (/Z{7|i|I}
).
To disable compile-time PDB generation, omit the /Z
switch (/Z{7|i|I}
).
[Edit] 哦,其实如果你使用/Z7
开关,调试信息会生成到目标文件而不是PDB中.所以那个特定的没问题.然而,没有它编译会更快.因此,如果您不想要任何调试信息,请省略.
Oh, in fact if you use the /Z7
switch, the debug information is generated into the object file instead of a PDB. So that particular one is okay. Compilation is faster without it, however. So omit if you don't want any debug information.
这篇关于从命令行抑制 PDB 生成 - C++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!