While migrating an old C++ project from Visual Studio 6 up to Visual Studio 2012, we came across an odd set of warnings from inside the standard Microsoft platform headers:
An online search only found a few other people running into this error. In some cases, it was people trying to use VS2012 to compile legacy DirectX code - which I am not doing. In other cases, it was people trying to use VS2012 to target Windows XP (using the new option from Update 1) - which I am doing.
The DirectX question was answered that the warning will always be there to tell you that you're compiling with an out-of-date (pre-Win8) version of DirectX, and you'll just have to live with it.
The Windows XP question was not answered. Other people simply said that they couldn't reproduce the problem.
I reproduced it, and found the cause, which I am writing up here to help anybody else who encounters this.
Go into the project properties, and find the "Preprocessor Definitions" field.
In addition to the default and added definition constants, you should see a macro:
%(PreprocessorDefinitions)
This macro apparently brings in some additional compiler-provided preprocessor definitions. I am not sure what version of Visual Studio introduced this macro, but it was not there in Visual Studio 6.
In Visual Studio 2012, this macro is required to be present in your project's Preprocessor Definitions field. It may also be required in earlier versions of Visual Studio, but I have not tested these.
If this macro is missing, you will see the error messages as shown above.
UPDATE:
See Edmund's answer to this same question first -- give that a try. If it works, great! If not... try the following:
ORIGINAL:
Use the workaround mentioned on the "Workarounds" tab of this web page:
http://connect.microsoft.com/VisualStudio/feedback/details/789965/resource-editor-warning-rc4005-on-toolset-visual-studio-2012-windows-xp-v110-xp
Namely, add:
#define _USING_V110_SDK71_ 1
...directly in the .rc file before it includes anything that would include the system headers that cause this warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With