Reputation: 1513
I ran my project in release mode and I had no problem. and than I changed the mode to debug mode and I have an error "debug assertion failed".
That's the code that caused it:
QXmlStreamReader* xmlReader = new QXmlStreamReader(xmlFile);
xmlReader->readNextStartElement();
QXmlStreamAttributes attributes;
attributes = xmlReader->attributes();
cout << (attributes.value("name").toString().toStdString());
After this cout line I had the error massage.
What can be the difference between the modes that caused the difference?
I want to know what I need to change for running the project in debug mode.
Upvotes: 0
Views: 908
Reputation: 29017
The difference between the modes is that in release mode
assert( expr );
compiles to nothing. In debug mode it compiles to something like:
if (!(expr))
assert_failed( "expr" );
(The above is to give the flavour, there are some subtleties). What this means is that you didn't notice the problems in release mode (you probably did something like write over some unused memory). Murphy's Law says that you will notice the problems when you come to demo to a big customer / your professor.
If you look at the line where the assertion occurs, it will tell you what it is complaining about. You need to fix that.
Upvotes: 1