简体   繁体   English

为Windows XP x86编译程序

[英]Compiling a program for Windows XP x86

I wrote a windows forms application using VS2012 on windows 8 computer (x64) and I want it to run on Windows XP x86. 我在Windows 8计算机(x64)上使用VS2012编写了一个Windows窗体应用程序,并且希望它在Windows XP x86上运行。 When I try to run the program I get error "... is not a valid windows 32 application." 当我尝试运行该程序时,出现错误“ ...不是有效的Windows 32应用程序”。 How can i fix it? 我该如何解决?

  • Right Click Project Name on solution Explorer. 在解决方案资源管理器上右键单击“项目名称”。
  • Select Properties 选择属性
  • Select Build Tab 选择构建选项卡
  • Select x86 option for Platform target DropDownList 为平台目标DropDownList选择x86选项
  • Save and build the project 保存并构建项目

Also make sure that you target the .Net Framework Version same as the version present in Testing machine. 还要确保将.Net Framework版本的目标定位为与Testing Machine中存在的版本相同。

If you are building C++ project then try this: 如果要构建C ++项目,请尝试以下操作:

General -> Platform Toolset -> Visual Studio 2012 -> Windows XP (v110_xp) 常规->平台工具集-> Visual Studio 2012-> Windows XP(v110_xp)

Its better that you choose the target as Any CPU . 最好将目标选择为Any CPU。

The compiler shall decide how to invoke the program ( x86 or x64 ) when you choose the Any CPU option , also choose the Any CPU platform. 选择Any CPU选项时,还应选择Any CPU平台,编译器应决定如何调用程序(x86或x64)。

在此处输入图片说明

Maybe far away guess with given that less information. 鉴于信息量较少,也许很遥不可及。

You should change Compile Target to x86 from 您应该将Compile Target从更改为x86

Project->Application Properties->Compile 

Set Target CPU to x86

It sounds like you may be experiencing issues related to the Windows XP Targeting for C++ in Visual Studio 2012. Support for Windows XP with C++ targets was added in Visual Studio 2012 Update 1, but must still be explicitly selected in your project properties. 听起来您可能遇到了与Visual Studio 2012中的Windows XP Targeting for C ++有关的问题。VisualStudio 2012 Update 1中添加了对具有C ++目标的Windows XP的支持,但仍必须在项目属性中明确选择。

Windows XP Targeting with C++ in Visual Studio 2012 在Visual Studio 2012中使用C ++定位Windows XP

There is a great deal of additional information at the above link, but the specific setting you are looking for in the C++ project properties is General → Platform Toolset → Visual Studio 2012 - Windows XP (v110_xp) 上面的链接上有大量附加信息,但是您要在C ++项目属性中寻找的特定设置是“常规”→“平台工具集”→“ Visual Studio 2012-Windows XP(v110_xp)”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 批量编译WinRT和Windows x86的C#代码 - Batch compiling C# code for WinRT and Windows x86 VS2012项目x86目标未在32位Windows XP上运行 - VS2012 project x86 target not running on 32 bit Windows XP C# - 如何在 Windows 64 位上获取程序文件 (x86) - C# - How to get Program Files (x86) on Windows 64 bit 使用Process.Start()从程序文件(x86)启动Windows进程 - Start a Windows Process from Program Files (x86) using Process.Start() 为什么编译为任何产生x86 exe的CPU? - Why is compiling as Any CPU producing an x86 exe? 使用x64安装程序卸载Windows服务时,Environment.SpecialFolder.ProgramFiles返回“程序文件(x86)” - When uninstalling a windows service with a x64 installer , Environment.SpecialFolder.ProgramFiles returns “Program Files (x86)” SQLite在Windows Phone上强制使用x86,但不能在WP设备上运行x86吗? - SQLite forces x86 on Windows Phone, but can't run x86 on WP Devices? Win XP(x86)操作系统上的二级属性绑定异常,但不是Win 7(x64) - Second Level Property Binding exception on Win XP(x86) OS but not Win 7(x64) 如何将文件复制到C:\\ Program Files(x86)\\ - How to copy file to the C:\Program Files (x86)\ 更新程序文件(x86)文件夹中的DLL - Update DLLs in the Program Files (x86) Folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM