I am following the C++ Debugging tutorial section (https://help.eclipse.org/photon/index.jsp) in the Eclipse Photon documentation. I have followed all the instructions creating the first C++ project and I'm at the 'Debugging project' section. My problem is that after I create my debug perspective and hit the 'Debug' button the debugger never stops on my set breakpoint. In the Debug window it just says and the loop of the program doesn't even produce any output at all. If you run the program normally the loop prints to the console, but nothing happens in debug perspective.
I have tried deleting my debug perspective and creating a new one and I'm having the same issues. I have uploaded screenshots of my debug configuration.
https://imgur.com/a/MXYHxJl
https://imgur.com/a/eEU47Ht
https://imgur.com/a/koOf08x
#include <iostream>
using namespace std;
int main () {
// Say HelloWorld five times
for (int index = 0; index < 5; ++index)
cout << "HelloWorld!" << endl;
char input = 'i';
cout << "To exit, press 'm' then the 'Enter' key." << endl;
cin >> input;
while(input != 'm') {
cout << "You just entered '" << input << "'. "
<< "You need to enter 'm' to exit." << endl;
cin >> input;
}
cout << "Thank you. Exiting." << endl;
return 0;
}
I found a solution to my problem following instructions in this other post: Eclipse C++ MinGW - Can not Lauch Program <Terminated> The 2nd answer is what worked for me.
I had to right click on my project - - > properties - -> Run/Debug settings - - > click your launch configuration and click 'edit'. Once inside the edit screen click the 'environment' tab and add the following variable Name = PATH VALUE = %PATH%;C:\MINGW/BIN
I did not have anything set inside the environment and changing to the above has made the debugger stop at the correct breakpoints within the program.