什么是&QUOT的目的; preFER 32位"在Visual Studio 2012中设置,它是如何实际工作?

编程入门 行业动态 更新时间:2024-10-26 04:31:01
本文介绍了什么是&QUOT的目的; preFER 32位"在Visual Studio 2012中设置,它是如何实际工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这我不清楚如何编译器会自动知道要编译64位时,它需要。它怎么知道什么时候可以自信地针对32位?

It is unclear to me how the compiler will automatically know to compile for 64-bit when it needs to. How does it know when it can confidently target 32-bit?

我主要是好奇编译器如何知道哪些架构编译时的目标。它分析code,并根据其发现的决定?

I am mainly curious about how the compiler knows which architecture to target when compiling. Does it analyze the code and make a decision based on what it finds?

推荐答案

这就是这么奇怪,没有人链接到博客条目的 What值为anycpu实际上意味着作为.NET 4.5和Visual Studio 11 的:

It is so strange that nobody links to the blog entry What AnyCPU Really Means As Of .NET 4.5 and Visual Studio 11:

在.NET 4.5和Visual Studio 11中的奶酪已被移动。该  默认为最.NET项目再次值为anycpu,但有一个以上  一个意思到现在值为anycpu。还有一个额外的分型值为anycpu的,  任何CPU的32位preferred,这是新的默认(总体来说,  现在用于/平台的C#编译器开关五个选项:86,  安腾,X64值为anycpu和anycpu32bit preferred)。当使用  值为anycpu味道,语义如下:

In .NET 4.5 and Visual Studio 11 the cheese has been moved. The default for most .NET projects is again AnyCPU, but there is more than one meaning to AnyCPU now. There is an additional sub-type of AnyCPU, "Any CPU 32-bit preferred", which is the new default (overall, there are now five options for the /platform C# compiler switch: x86, Itanium, x64, anycpu, and anycpu32bitpreferred). When using that flavor of AnyCPU, the semantics are the following:

      
  • 如果这个过程在32位Windows系统上运行时,它会作为一个32位进程。 IL被编译为x86计算机code。
  •   
  • 如果这个过程在64位Windows系统上运行时,它会作为一个32位进程。 IL被编译为x86计算机code。
  •   
  • 如果进程中的一个ARM的Windows系统上运行,它会作为一个32位进程。 IL被编译成ARM机器,code。
  •   

的区别,那么,与任何CPU的32位preferred和86是  只有这个:编译为86 .NE​​T应用程序将无法在一个运行  ARM的Windows系统,而是一个任何CPU的32位preferred应用程序将  成功运行。

更多推荐

什么是&QUOT的目的; preFER 32位"在Visual Studio 2012中设置,它是如何实际工作?

本文发布于:2023-11-02 13:59:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1552594.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:目的   它是   工作   preFER   QUOT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!