none
VS2008 - Release Build sets linker opt /DEBUG ??

    Question

  • Hi,
     
    In Visual Studio you can have "debug" and "release" configurations. You can
    switch between them in the project properties dialog. The default settings
    will generally be tailored to each configuration. However, I noticed that in
    many of my native C++ projects, the "release" configuration has the
    following linker options:
     
    1. Generate Debug Info : Yes (/DEBUG)
    2. Generate Program database file : $(targetdir)$(targetname).pdb
     
    Is this normal??
     
    • Moved by Larcolais Gong Tuesday, February 01, 2011 8:33 AM (From:Visual Studio Setup and Installation)
    Friday, January 28, 2011 2:42 PM

Answers

  • Yes this is normal. By default, even in "Release" configuration, the debug info file (.pdb) is created.

    This is just for extremely unlikely case that a released app crashes and someone needs to debug it. But this never happens to Real Programmers ;) so these are free to disable /DEBUG.

    --pa

    Wednesday, February 02, 2011 2:31 AM
  • Hi Gerry,

    It is not possible to create an .exe or .dll that contains debug information. Debug information is always placed in a .pdb file. Therefore, either debug build or release build places the debug information in the corresponding .pdb file. The major difference of output build between debug and release is optimization. And debug build using Program Database for Edit & Continue (/ZI) for generate pdb file which is used for Visual Studio Debugger but release build only use Program Database (/Zi).

    Generate debug information for release build is useful sometime. For example, your customer may send you the dump of a crash of your released application; you can use such pdb file to get more detail information for the dump. Of cause, as Pavel said, if you don’t want to generate such pdb files, you can just feel free to turn off the switch.

    Hope the explanation helps.

    Regards,

    Yi

     


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, February 10, 2011 8:09 AM
    Moderator

All replies

  • Hi,

    I have a similar problem.

    I am currently working on small VB WPF program for .NET Framework 3.5 SP1,

    and even when Properties > Compile has the settings

    . Configuration: Release

    . Build output path: bin\Release\

    . Advanced compile options > General debug info: None

    and Properties > Debug has the setting

    . Configuration: Release

    VS always builds only a debug .exe in \bin\Debug. In VS 2005 there was the option to compile a Release version. Has this feature been dropped in VS 2008?

    Is this a VS bug, or are there settings I can modify to obtain the expected behaviour?

    Visual Studio 2008 Pro, Version 9.0.30729.1 SP on Windows XP SP3

    JPL

    Saturday, January 29, 2011 3:27 PM
  • The problem was that settings in Build > Configuration Manager... (which I did not recognise at all - I cannot have looked there since the day VS was installed) were constraining those within the project properties.

    Gerry,

    Apologies for confusing your thread. I thought I had a similar problem and the additional notes would help in solving your problem. As it turned out, this proved incorrect.

    JPL

    Sunday, January 30, 2011 7:01 PM
  • Hi Gerry,

    Any update? Has your question been resolved?

    Best Regards,

    Larcolais


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 31, 2011 6:12 AM
  • Hello Larcolais,
     
    The question has not been resolved. Please see the original post.
     
    Thank you.
     
    Monday, January 31, 2011 2:32 PM
  • "JPL5780" wrote in message
    news:982f981f-5acc-4e98-a390-5847215e2b84@communitybridge.codeplex.com...
    > The problem was that settings in Build > Configuration Manager... (which I
    > did not recognise at all - I cannot have looked there since the day VS was
    > installed) were constraining those within the project properties.
     
    Yes, you can change the project settings for debug/release, but the
    "Configuration Manager" determines the "Active Configuration" and "Active
    Platform".
     
     
    Monday, January 31, 2011 2:37 PM
  • Gerry Hickman wrote:
    > Hello Larcolais,
    > The question has not been resolved. Please see the original post.
    > Thank you.
     
    I'm also seeing this is VS2010.
     
    I'm using the VC++ Win32 Console project type.
     
    Tuesday, February 01, 2011 8:31 PM
  • Yes this is normal. By default, even in "Release" configuration, the debug info file (.pdb) is created.

    This is just for extremely unlikely case that a released app crashes and someone needs to debug it. But this never happens to Real Programmers ;) so these are free to disable /DEBUG.

    --pa

    Wednesday, February 02, 2011 2:31 AM
  • Hello,

    I am writing to check the status of the issue on your side.  Would you mind letting us know the result of the suggestions? 

    YI


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 04, 2011 3:28 AM
    Moderator
  • Hello Yi,
     
    I did not find helpful any of the answers so far.
     
    There are two build profiles in Visual Studio - "Debug" and "Release"
     
    The linker options in the "Release" configuration are set to include
    debugging information in the COFF by default - this seems wrong to me.
     
    The "Release" configuration should mean it's ready for commercial release.
     
    If a programmer want's to create a "Release" build with "special" debug
    options, because they have not tested their program correctly, then
    surely it's the programmer's responsibility to create a special
    configuration called "ReleaseD"?
     
    Thanks for the help with this.
     
    Yi Feng Li wrote:
    > Hello,
    >
    > I am writing to check the status of the issue on your side. Would you mind
    > letting us know the result of the suggestions?
    >
    > YI
    >
    > --------------------------------------------------------------------------------
    > Yi Feng Li [MSFT]
    > MSDN Community Support | Feedback to us<mailto:msdnmg@microsoft.com>
    > Get or Request Code Sample from Microsoft<http://1code.codeplex.com>
    > Please remember to mark the replies as answers if they help and unmark them if
    > they provide no help.
    >
     
     
    Tuesday, February 08, 2011 11:06 PM
  • Hi Gerry,

    It is not possible to create an .exe or .dll that contains debug information. Debug information is always placed in a .pdb file. Therefore, either debug build or release build places the debug information in the corresponding .pdb file. The major difference of output build between debug and release is optimization. And debug build using Program Database for Edit & Continue (/ZI) for generate pdb file which is used for Visual Studio Debugger but release build only use Program Database (/Zi).

    Generate debug information for release build is useful sometime. For example, your customer may send you the dump of a crash of your released application; you can use such pdb file to get more detail information for the dump. Of cause, as Pavel said, if you don’t want to generate such pdb files, you can just feel free to turn off the switch.

    Hope the explanation helps.

    Regards,

    Yi

     


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, February 10, 2011 8:09 AM
    Moderator
  • Hello,

    Would you mind letting me know the result of the suggestions? If you need further assistance, feel free to let me know. I will be more than happy to be of assistance.

    YI


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 14, 2011 2:34 AM
    Moderator