Still having _ITERATOR_DEBUG_LEVEL problem

Hello, I’ve been having various bugs with oF- this is one that always seems to pop up.

I found this thread where there’s a very long discussion about it. @arturo marks the issue as having been fixed by ofxProjectGenerator, which I assume is what you run from openFrameworks/projectGenerator/projectGenerator.exe, which is what I’ve always used to generate my projects.

so I redownloaded openFrameworks for Windows VS 2017-2022, replaced all the files in my openFrameworks directory with the contents of the .zip, except for my apps folder and recompiled an old tutorial project that includes ofxGui but doesn’t actually use it.

I generated (Update), open it in VS2019, right-click on the Solution in the Solution Explorer and retarget it to v142

  1. Build settings are: Release, Win32. I press F5 and it runs with no problem.
  2. Rebuild as Debug, Win32. Press F5. Runs with no problem.
  3. I return the build settings to Release, Win32. Press F5 and I get these three errors over and over for a bunch of ofxGui objects:
|Severity|Code|Description|Project|File|Line|Suppression State|
|---|---|---|---|---|---|---|
|Error|LNK2038|mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in main.obj|004_3DShapes|C:\Users\selli\openFrameworks\apps\openFrameworksTutorialSeries\004_3DShapes\ofxBaseGui.obj|1||
|Severity|Code|Description|Project|File|Line|Suppression State|
|---|---|---|---|---|---|---|
|Error|LNK2038|mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in main.obj|004_3DShapes|C:\Users\selli\openFrameworks\apps\openFrameworksTutorialSeries\004_3DShapes\ofxBaseGui.obj|1||
|Severity|Code|Description|Project|File|Line|Suppression State|
|---|---|---|---|---|---|---|
|Error|LNK2001|unresolved external symbol __imp__invalid_parameter|004_3DShapes|C:\Users\selli\openFrameworks\apps\openFrameworksTutorialSeries\004_3DShapes\ofxBaseGui.obj|1||

I repeat steps 1)-3) for x64 and the result is the same. This only happens when I have addons in the project. If I remove ofxGui in the ProjectGenerator, I can switch between Debug and Release mode with no issue.

I think this problem has always been here and I’ve just worked around it by recompiling every time I want to switch back from Debug to Release build, but since I’m currently trying to debug some other issues with running video (which runs slower in Debug) I’d really like to be able to switch back and forth freely.

Please tell me what I’m doing wrong!

the error means you are mixing debug and release code. possibly VS isn’t picking up on certain changes, but i’m not sure.

does a full rebuild solve your problem?

and did you try deleting everything you don’t need (.vs folder, obj folder, all sln and vcxproj files), and then regenerating from scratch?


ps. i’m on of_0.10 with vs2017 and xcode10, and of_0.11 with vs2019 and xcode?? (quite new), and while i’m aware of the issue in general (possibly outside OF), i don’t recall having such problems.

1 Like

Hm, well with more recently made projects I’m not having this problem anymore, so I guess not deleting those files, as you said, was the problem. No idea why it got that way though…

@kritzikratzi

It’s happening again now with a newer project (it wasn’t an issue for a while) Even if rebuilding temporarily solves the issue, it’d be nice to stop it from coming up again.

Now something I’m a bit unsure of is that there are seemingly two steps to debugging in VS:

  1. Set build to Debug or Release in the drop-down menu under the tool bar.
  2. Press either F5 start debugging or Ctrl+F5 to start without debugging.

Now I’d assume you want to choose Debug and press F5 when debugging and choose Release and press Ctrl+F5 when not debugging.

Choosing Debug and pressing Ctrl+F5 runs the debug build without debugging, which I guess is just slow with no merit. Could my doing this or the inverse - Choosing Release and pressing F5 be permanently messing up the project?

no idea. i’m randomly hit by this problem, and i just live with it.

or go in between: Faster debugging in Visual Studio [a simple trick]

You’re randomly hit by it? But you said

and while i’m aware of the issue in general (possibly outside OF), i don’t recall having such problems.

And thanks for the link. I’ll try it out!

hm… there’s a few projects that i’m maintaining irregularly, some are in OF, some just cmake. i really wouldn’t know for sure. like… when i see this problem my brain just goes “right… this thing, just rebuild”. i know i recently updated an OF app and had no such problems. idk, i don’t remember everything :slight_smile: