I had the same error. In my case the solution is easy: I had one project A depending on another project B. B had a preprocessor definition _DEBUG in debug mode and A didn't.
Just add _DEBUG to project A(project->properties->c++->preprocessor->preprocessor definitions) and you're done.