Visual Studio 2012 requires Windows Vista and higher by default. Microsoft has announced that XP will no longer be supported in about two years. I believe that they will go as far as they did with Win98 -- completely make it unavailable and unsupported and DEAD -- permanently. 2012 is the first step towards this inevitable demise. It won't be that they just ignore it -- they will actively make it impossible to develop code for XP, soon. They want it to totally go away.
Before I answer, some thoughts:
• You should not need stdafx.h for a console32 application written in c/c++. That is for Microsoft's Application Framework Extensions -- what became the Microsoft Foundation Classes. Not needed for a console32 app.
Start a new project. Under templates, select and open up the C++ drop down list and select Win32 Console Application. Select the lowest numbered .NET (2.0) from the list, as well. You don't need .NET at all, though. Then continue (click OK) on to the next dialog (Application Wizard) and click on the "Application Settings" entry on the left side. Make sure the ATL and MFC boxes are NOT checked. Make sure "Console Application" radio button IS selected. Uncheck "precompiled header". Uncheck SDL. Check the "Empty project" box! [Otherwise you get stdafx and _tmain(). BAD!]
• Go to File, then New, then File..., and click. Pick C++ on the left side and then select the C++ File on the right. Hit "OPEN" and type in your basic main() function:
int main() {
return 0;
}
Do "Save As" and save the file in the project directory (you probably will need to 'drill down' into a directory or two to do that, at first.) Once that is done, go over to your "Solution Explorer" (on the far right side, likely) and find the "Source Files" folder under your project name. Right click it, select Add..., and then select "Existing Item..." and find your source code file. Select it and add it to the project. It should then appear underneath the Source Code entry. [You can also do this from the Solution Explorer, right clicking on the Source Files folder and selecting Add... and then
and going that route, as well.]
• If you want to absolutely double-check the idea of 64-bit code generation (used to be you couldn't get a 64-bit compiler for Express Editions, but I'm not sure of that anymore and I don't want to download and install to find out -- I'm using Professional 2012 here), you can go over to the Solution Explorer again and right click the project's name (above the External Dependencies item) and then select "Properties." Once you are there, look for a button on the top right side called "Configuration Manager..." and click it. If your active solution platform is Win32, you are good. If you want to look in there to see if x64 is available, then drop down the Win32 entry under "active solution platform" and pick "" and then under "type or select the new platform" drop that down and see if you can find the x64 entry there. I don't think this is the issue, despite the comments you've already received from others.
Answer: Go to Solution Explorer, right click the project name, select "Properties," select "Configuration Properties" on the left side and drop down options. Click on "General" on the left. Look for "Platform Toolset" on right. Set to "Visual Studio 2012 - Windows XP (v110_xp)" or else, if you have installed Express 2010 as well, you may also see "Visual Studio 2010 (v100)" or "Visual Studio 2008 (v90)" as other options. I think all those will work. Do not use "Visual Studio 2012 (v110)". Once you are there, look for a button on the top right side called "Configuration Manager..." and click it. You also need to make sure you don't require DLLs to be shipped. So now go back to the left side where you'd clicked "General" and pick "C/C++" instead. Then select "Code Generation" next. Now look to the right and find "Runtime Library" and change it to "Multi-threaded (/MT)". Go to "Precompiled Headers" on left, erase everything there on the right. Select "All Options" on left. Find "Common Language RunTime Support" and select "No Common Language RunTime Support". Go under C/C++ on left, select "General", undo the SDL checks selection -- not needed. Now build. See if that helps.
You don't need tchar.h or windows.h or stuff like that for a typical console app. You were forced for other reasons. If you really do want them for whatever reason, the above still helps you deploy an XP app.