'How can I debug a .exe from the command line with a .exe generated from cl.exe (Visual Studio C/C++ Compiler)?

How can I debug a .exe from the command line with a .exe generated from cl.exe (Visual Studio C/C++ Compiler)?



Solution 1:[1]

If you aren't going to use a proper debugger (such as found with the full version of visual studio or windbg.exe) then your best bet will be old fashioned printed log traces. Add code (when usingh cl.exe usually bracketed by #ifdef _DEBUG/#endif directives) that print messages to the console about your current program state. Using a real debugger is, however, generally much easier.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SoronelHaetir