I've been developing on VC++ 2003 on an XP PC but am now on Windows 7 and bought a cheap legal copy of VS 2008 to continue work on the same project. My product has to continue to run on customers' XP systems, so I'm strictly interested in a 32-bit executable.
The first issue I ran into was the PRJ0003 error "spawning cl.exe". I had to add the path to this file to the VC++ Directories settings (it appears in both a bin\amd64 and bin\x86_amd64 directory, but I don't think it matters output-wise which I use?).
The issue I now have (not counting a tedious cleanup to convert strcpy to strcpy_s, etc.) is that I'm not clear on whether I'm generating a 32-bit or 64-bit exe out of this. My project properties are set to a target of "Win32", so I assume that all is well. Is this correct?
I have read some discussions about this, but it's never quite clear if they are talking about whether the compiler itself is running x64 vs. x86, or whether the compiled code is x64 vs. x86, and how this is differentiated.
So am I doing the right thing to generate a 32-bit, Win32, x-86 program?
Assuming that you haven't got a totally messed up installation then in VS2008 it's very hard to accidentally create 64-bit executables with a 32-bit project platform (I've been trying to force it to do so for my own reasons and it always seems to mess up at the link stage). If however your project uses Makefiles then it's a lot easier to end up with the wrong 32/64 bitness, especially if you are building from the command line. Generally, unless you have specifically set up a 64-bit project then everything should just be building 32-bit.
Given that it looks like the compiler paths are messed up I would suggest doing a repair of VS2008 and then do Tools -> Import and Export settings -> Reset all settings. Then check out a clean source tree to ensure you don't have any incorrect build artifacts.
As for the strcpy_s
fix up, bear in mind that the compiler is giving you a warning rather than an error. If you don't want to be warned about it then simply set _CRT_SECURE_NO_WARNINGS
as a preprocessor macro.