How to debug in Dev C++

 

In Dev-C++, you need to put your work into a project so that the debugger can run.

You need to go to file/new project and choose a console application.

Dev-C++ will prompt you for a name of the project and then create it.  

You need to make sure that you have debugging info enabled before you compile.  Go to Opions/Compiler Options/Linker and check "generate debug information".

After you have entered your C++ code and compiled, initiate the debugger by going to Execute/debug or press F8.

If you generated debugging information, the debugger should come up with your source code visible.  You can then set breakpoints, set watch variables and step through the code.

Also, you can make line numbers visible in your source code by going to Options/Environment Options/Preferences and check off "show line numbers".

We installed Dev-C++ downtown; and I have installed Dev-C++ at Boyce.  I will demonstrate the Dev-C++ and debugger for the Boyce and Downtown sessions in our next class.

To allow you to install Dev-C++ at home, I have included instructions in the 505 page on my website and a link to Dev-C++ (called C++ Compiler IDE) on my main page. At the Dev-C++ site, go to latest version and download the Dev-C++ without compiler and the latest version 4.01. 

After you download, you can use the install option in Winzip for installing Dev-C++ and you can extract the 4.01 version using Winziop to your Dev-C++ directory.