Why can't I debug wxDev C++

  • Thread starter Thread starter YuZhao
  • Start date Start date
I never worked with wxDev, but most likely you are not running your code in a debug mode.
 
I never worked with wxDev, but most likely you are not running your code in a debug mode.

i just checked it again. I am pretty sure that i am in debug mode this time. Actually, this problem has been for a while.
 
Probably you either haven't compiler your code with debugging symbols included in or, on the other extreme, maybe you turned on such a level of optimization that the code you're trying to insert a breakpoint in is optimized out. But - it would be much better if you could create some small project and post here, with an explanation on what would be the exact sequence of steps to reproduce your problem - this way other people would be able to check, and eventually try to help.
 
What is the specific problem? I think I can help you since I have some experience with DEV. But it is too old, which hasn't been updated for long.
 
What is the specific problem? I think I can help you since I have some experience with DEV. But it is too old, which hasn't been updated for long.

Thanks, Tsotne. For example, the code is:
Code:
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
    cout << "hello world" <<endl;
    system("PAUSE");
    return EXIT_SUCCESS;
}
I add a breakpoint at the line cout << "hello world" and I expect my program to stop at this line. However, my compiler goes directly to the end of the program and does not stop anywhere.
 
Probably you either haven't compiler your code with debugging symbols included in or, on the other extreme, maybe you turned on such a level of optimization that the code you're trying to insert a breakpoint in is optimized out. But - it would be much better if you could create some small project and post here, with an explanation on what would be the exact sequence of steps to reproduce your problem - this way other people would be able to check, and eventually try to help.
This is really weird. I think there is some problem with my compiler comfiguration. When I debugged the hello world again, there popped up a windows saying someting about debug information and asked if I want to add debug information(I dont recall exactly what it says). And I clicked yes. The hello world program stops at my breakpoint this time. However, when i went back to my previous program, the problem was still there.
 
Thanks, Tsotne. For example, the code is:
Code:
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
    cout << "hello world" <<endl;
    system("PAUSE");
    return EXIT_SUCCESS;
}
I add a breakpoint at the line cout << "hello world" and I expect my program to stop at this line. However, my compiler goes directly to the end of the program and does not stop anywhere.

There must be some sort of "build options", "project properties" or something like that where you can specify the compiler flags. The compiler has to be told to add debugger information to the compiled code -- otherwise the debugger won't work.

Since wxDev is based on the old Dev-C++, try Options/CompilerOptions/Linker/Generate debugging information
 
@YuZhao Have you found the solution? Unless you are on an old PC with weak properties, wxDEV is not encouraged at all. I'm not sure if it is used frequently nowadays since it hasn't been updated for long and lacks many good features other compilers have.
 
thank you all guys. I downloaded Visual studio. it is pretty cool and it fixes all the debugging problems I had before. I was using wx decC++ just because my professors like us to use it in the intro CS class. I guess it is time for me to try something new now...
 
Back
Top Bottom