<分区>
Possible Duplicate:
Issue using Visual Studio 2010 compiled C++ DLL in Windows 2000
类似这些问题:
Can I use Visual Studio 2010's C++ compiler with Visual Studio 2008's C++ Runtime Library?
Can VS2010 create native executable file working under Windows 2000?
我有在 WinXP 机器上使用 VS2010 (CL 版本 16.00.30319.0) 从命令行(使用 CL.EXE)编译的 C++ 代码,但我希望生成的 native (x86) 可执行程序能够在 Win2000、WinXP 等平台上运行。
旧版本的 CL(VC98,版本 12.00.8186)可以很好地完成工作,但 VS2010 版本生成的可执行文件在 Win2000 上运行时会导致弹出错误:
foo.exe is not a valid Win32 application
解的形式必须是CL compiler或 linker options ,而不是 VisualStudio 设置或属性。我不需要任何较新的 C++ 语言功能,因为代码是几年前的,并且编写为可移植到其他操作系统,我只需要 native 代码(x86,而不是 .NET 或 CLI)可执行文件。
(有关示例,请参见 http://david.tribble.com/src/crlf.cpp 和 http://david.tribble.com/src/detab.cpp。)
我想我可以在我的新开发环境(WinXP,最终是 Windows 7)上继续使用旧的编译器 (VS 9.0),但这似乎不是一个理想的解决方案。 MS 肯定仍然提供了一种创建 native 可执行文件的方法,这些可执行文件向后兼容旧的但仍然存在的 Windows 操作系统?