The g++'s -g option equivalent to VS2010 cl compiler?

前端 未结 2 656

With g++ with -g option, I can use gdb for debugging purposes.

What\'s the equivalent to this option with Visual Studio 2010 cl.exe compiler?

This page has d

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-08 08:36

    You're looking for one of the debug information generation options (/Z7, /Zi or /ZI).

    If you use one of those, you should also pass the /DEBUG option to the linker.

    You will also need to link against the debug version of the runtime libraries (/MDd or /MTd). This is important because these versions are different from their release counterparts (e.g. their memory allocations routines are not compatible).

提交回复
热议问题