Solution for force clean/rebuild after build configuration change on VS2017


#1

Here is how to regenerate problem.

Condition

  • Windows10
  • VS2017
  • oF 0.10.0
  • only happen when you use addons
  1. Build project in Debug mode(like guiExample)
  2. change to Release mode and build
  3. back to Debug mode and build
  4. You get an link error like
    Error LNK2038 mismatch detected for ‘_ITERATOR_DEBUG_LEVEL’: …
  5. You can not link/launch again until cleaning the project.

This seems like because of a setting of obj file output path. After first compile, /addons folder will be generated in same level of your project directory. This contains obj files of ofaddon. Please delete this.
I’m not sure where is the best place to put obj files for addons.
But I can solve this problem by changing like a screenshot below.
Please note that original setting is $(IntDir)/%(RelativeDir)/ and I change it to $(IntDir)

Then obj files are generate under /emptyExample/obj/Release(or Debug)
And you can now stop the error and recompile.


#2

It really helps me!
B.T.W. in this way source files from different directories can not have the same name.


#3

This fix merged to patch-release branch on GitHub.
But slightly different way.

And indeed it still does not solve “same file name from different folder” problem. I wrote temporary solution at here. Please try :slight_smile:

https://github.com/openframeworks/openFrameworks/pull/6122

p.s. There are two Pull Request(6122 and 6130) because I made a mistake on first one.