目标机"&QUOT的目的;在Visual Studio场 - >连接器 - >高级选项 - >目标机 [英] Purpose of "Target machine" field in Visual studio -> Linker-> Advanced Options->Target Machine
问题描述
我移植32位的C ++应用程序到64位(使用VS2008)。 我不知道这是什么意思领域在VS2008 ::
I'm porting a 32-bit C++ app to 64-bit (using VS2008). I'm not sure what does this field mean in the VS2008 ::
Visual studio ->Configuration Properties-> Linker-> Advanced Options->Target Machine.
在默认情况下它的值设置为未设置。 是否必须改变它的值改为MACHINEx64如果我想我的应用程序移植到64位可执行文件。
推荐答案
是的,这是一个非常重要的选项。它集 IMAGE_FILE_HEADER.Machine 在可执行文件字段。 EXE或DLL头的第一个字段。
Yes, this is a very important option. It sets the IMAGE_FILE_HEADER.Machine field in the executable file. The very first field of the EXE or DLL header.
视窗检查了这一点:加载一个EXE文件,并且知道它是否需要创建一个32位或从该领域的64位进程。这是一个链接器+高级属性页的唯一原因是因为你通常不改变它。该设置是pre-选择您所创建的项目配置。如果您得到未设置,那么你基本上是做错了,很难猜测你在做什么。
Windows check this when it loads an EXE and knows whether it needs to create a 32-bit or a 64-bit process from that field. The only reason it is a the Linker + Advanced property page is because you don't normally change it. The setting is pre-selected by the project configuration you created. If you get "Not Set" then you are basically doing it wrong, hard to guess what you are doing.
假设你有一个正确配置的项目,建立一个工作的32位构建您的程序,创建了64位建立与构建+配置管理器。在活动解决方案平台组合框右上角,选择<新建...>
。在对话框中选择64。希望其他默认值(从复印设置= Win32中,选中创建新的项目平台)是正确的你。返回到链接器+高级属性页,并设置应改为MachineX64。
Assuming you have a properly configured project that builds a working 32-bit build for your program, you create the 64-bit build with Build + Configuration Manager. In the "Active solution platform" combobox at the upper right, select <New...>
. Pick "x64" in the dialog. Hopefully the other defaults (Copy settings from = Win32, Create new project platforms ticked) are correct for yours. Go back to the Linker + Advanced property page and the setting should have changed to MachineX64.
这篇关于目标机&QUOT;&QUOT的目的;在Visual Studio场 - &GT;连接器 - &GT;高级选项 - &GT;目标机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!