11

We need to surpress generation of debug symbols. The options availble under project properties/ configuration properties / c/c++ / general / debug information format, are equivalent to /Z7, /Zi and /ZI - I can't find a way to omit the /Zx flag entirely.

Unlike the situation here - we're building from the IDE.

I'm using visual studio 2010, and the project at hand is a static library.

EDIT: Here's the view from my installation of VS2012. Is this some installation issue?? Are your Debug-Information-Format options different? enter image description here

Community
  • 1
  • 1
Ofek Shilon
  • 14,734
  • 5
  • 67
  • 101
  • I don't get this question. You already found the "Debug Information Format" option in the IDE, why don't you set it to "Disabled"? – Hans Passant Jan 27 '13 at 10:30
  • 1
    My IDEs (VS2010/2012) don't have a 'disabled' option under Debug Information Format. Do you see one? – Ofek Shilon Jan 27 '13 at 16:04
  • Well, that's bizarre. Options in the dropdown list, in order, for VS2008 are Disabled, C7 Compatible, Program database, Program database for Edit & Continue. In VS2012 the first one is renamed to None. Don't have VS2010 anymore to check. – Hans Passant Jan 27 '13 at 17:07
  • Hans: please not the addition to the question. Thanks! – Ofek Shilon Jan 28 '13 at 10:01

2 Answers2

29

You can remove it manually:

Step 1. Compiler.

  • Selected "Configuration Properties > C/C++ > General > Debug Information Format"
  • Hit DEL

enter image description here

Step 2. Linker.

Also you need to disable generating Debug info for Linker

  • Selected "Configuration Properties > Linker > Debugging> Generate Debug Info" set to No

enter image description here

Step 3. Profiler.

  • Also set "Profile" to "No" in Linker > Advanced or you may still see PDB files generated!
Community
  • 1
  • 1
oleksii
  • 35,458
  • 16
  • 93
  • 163
  • @sɐunıɔןɐqɐp is that .net C++ version? I've never used it, to be honest. I've used .net or native C++ (but not C++/CLI). In both cases, there was an option to disabe this. It may be called slightly differently. – oleksii Jan 21 '20 at 17:14
2

First thing first - this is not recommended to disable .PDB generation, even for a Release Build!

Anyway, you just need to go:

  • Linker -> Debugging -> Generate Debug Info, and set it to No
Ajay
  • 18,086
  • 12
  • 59
  • 105
  • thanks. Trust me, I'm fully aware of the importance of PDB's, and still I need to disable their generation. As noted in the question I need to disable generation for a static library - which does not undergo linkage. I.e., I need to disable it at the compiler level - so this solution doesn't hold. – Ofek Shilon Jan 27 '13 at 06:42