This is just a quick post about this error I sometime have when I change the targeted platform of my C++/Cx project: “precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)“.
When I read this the first time, I didn’t have a clue of what the error could be. In fact…
.. I think this is a Visual Studio issue and you only have to clean the project once to make everything works on the next build.
Some will maybe think it’s not worth a blog post but I tried a lot of things (and wasted a lost of time – including not watching the last walking dead !!!) before to find out it was this easy. I hope this post will save you this time.
Have fun !
PS: the error code is “C1853”