• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Why can't I debug wxDev C++

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:
C++:
#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:
C++:
#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.
 
thats what i was referring to. should have been clearer.
 
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