0

I have a large C++ project (20 static libraries, 5 DLLs) and some sort of memory issue that I can't pinpoint. Printing to the CMD window is too unreliable and I go in circles, and I feel like running the project in debug mode is the only hope I have in identifying where this bug is.

However, I can't seem to build my project in debug mode because of the _ITERATOR_DEBUG_LEVEL error in VS.

The accepted solution seems to be to recompile everything at the same debug level. So I tried this and managed to compile all my DLLs (it was a huge can of worms) in the _ITERATOR_DEBUG_LEVEL=0 option.

But I'm still having the _ITERATOR_DEBUG_LEVEL error, I still can't compile my project in debug mode. EDIT The exact error is :

LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2'

It lists these files, where myProject is the project I am trying to compile. projectVRPNabc.o is from another project that was recompiled with _ITERATOR_DEBUG_LEVEL=0

projectVRPNabc.o
myproject123.o
myproject456.o
myproject789.o

Advice, help, please?

7
  • 1
    What is the exact error message, and what are the lines before and after it in the output log? In the question you link, the file client.cpp has a debug level of 0, and rtpsession.cpp was compiled with a debug level of 2. Which files are your problem files? Commented Apr 30, 2014 at 21:29
  • @MooingDuck I added the error, can you remove your downvote now so my question can get help from other people? Having a negative score significantly wards away others. Commented Apr 30, 2014 at 21:43
  • Huh, why doesn't your message look like the other one? Can you put the 5ish lines before and after that error from the output window into the question? (press Alt+2 to see it if it's missing) (renaming folders and files is fine) Commented Apr 30, 2014 at 21:47
  • @MooingDuck No. I am in the middle of a long process right now and cannot recompile to retrieve the entire error message. Hours from now when the recompile is finished, I can, but that will be hours away, and by then my chance of getting an answer will be very low as questions either tend to get their answers immediately or not at all (with the exceptions of straggler answers weeks or months later). So when my question ends up not getting an answer, then what? The only option I will have is to re-ask. And the re-asking will get closed because it's a dupe of this one. Please, be kind. Commented Apr 30, 2014 at 21:50
  • 1
    making a minor edit to the question, such as adding additional information, bumps it to the top of the "active" page, which should get people to view it. Commented Apr 30, 2014 at 22:06

2 Answers 2

2

_ITERATOR_DEBUG_LEVEL error in visual studio

See the comment here.

According to one of the comments it may be due to an old lib in your dir.

Sign up to request clarification or add additional context in comments.

3 Comments

Question specifically states that the exact answer you link to does not work
I was linking him to the comment specifically. The person asking the question said the solution did not work as well. He solved it with an old library
Oh. I replaced the link with one that actually links to the comment then, and clarified your wording.
0

There was indeed an issue where the DLL was not compiled with the necessary _ITERATOR_DEBUG_LEVEL in order for the project to compile.

To the naked eye, it would seem that the DLL was compiled under the proper settings in debug mode. This was a lie.

Instead, in the Configuration Manager, the project was set to compile as release mode. So pressing the button to compile when it said "Debug" would actually compile in release instead. The issue gets chalked up as bad user interface design. It also means that the toolbar is unreliable.

TL;DR : Visual Studio's toolbar was a lie.

Visual Studio 2010 Config Manager vs Config Toolbar

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.